I placed the code in my Windows Forms Application. Here is the code (note the highlighted areas):
Private Function PostFiles(ByVal theSession As String, _ ByVal theListFiles() As String, _ ByVal serverName As String, _ ByVal repositoryName As String, _ ByVal userName As String, _ ByVal passWord As String) As String()
Dim AnError(0) As String AnError(0) = "PostFiles failed"
Try Dim sendPostCommand As MVIServer.MVIxmlTools = New MVIServer.MVIxmlTools() ' the remote web service object Dim webResponse() As String
sendPostCommand.Credentials = CredentialCache.DefaultCredentials ' essential for windows authentication with web server webResponse = sendPostCommand.PostListFiles(theListFiles, _ serverName, _ repositoryName, _ userName, _ passWord, _ Principal.WindowsIdentity.GetCurrent.Name) ' the web service method call
LogMessage("PostFiles Completed", MessageType.Information) Return webResponse Catch ex As Exception Return AnError End Try End Function
|