I'm working on an application that must sent an XML file and receive an answer.
I generate the .xml as follows:
xmlText = "<Test>" & vbCrLf xmlText = xmlText & "</Test>" & vbCrLf Dim xmlFile As New MSXML2.DOMDocument xmlFile.async = False xmlFile.validateOnParse = False xmlFile.resolveExternals = False xmlFile.preserveWhiteSpace = True xmlFile.loadXML(xmlText) Then I delcare the service
Dim WS As New MSXML2.XMLHTTP60 With WS .open("POST", url, blnAsync) .setRequestHeader("Content-Type", "text/xml") .setRequestHeader("Connection", "close") .setRequestHeader("SOAPAction", "") Try .send(xmlFile) Catch ex As Exception Console.WriteLine(ex.ToString()) End Try End With After sending the .xml, no exception pops up but I can't get past to state 1, which is: The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method.
And can't get to the state 2: All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available.
Do you guys know how to find the solution or at least handle the error so I can see what it's wrong? As the .send(xmlFile) doesn't return any exception error.
Thank you.
No comments:
Post a Comment