Sending soapy XML with VBA
When using SoapUI 5.3, I can send the request successfully using the Query Editor (to the web service). I am trying to send a file using Excel VBA, but I cannot determine if it is done correctly or not.
I am using the VBA code below but only have 1 day of XML experience. I think the problem might be in the prologue or the header, but I'm not sure what it should be as there is no header in the request in the SoapUI. I have a link to Microsoft XML 6.0 suite.
Sub SendXMLtoSAA()
Dim myHTTP As New MSXML2.XMLHTTP60
Dim myDom As New MSXML2.DOMDocument60
Dim myXML As String
''myDom.LoadXML (myXML)
myDom.Load "C:\Users\me\Desktop\test.xml"
myHTTP.Open "post", myServer, False
myHTTP.send (myDom.XML)
MsgBox myHTTP.responseText
End Sub
I added <?xml version='1.0' encoding='UTF-8'?>
to the beginning of the XML code, but no matter what values ββare in the fields, I get the same responsetext
and don't know if it was "Added" correctly and if the values ββare acceptable, Should I be looking for some other value?
EDIT . It looks like it myHTTP.responseText
shows the original xml webservice.
RE-Edit : This is because I didn't remove the wsdl from the server link.
The other code I posted below was incomplete and unnecessary, so I removed it so others would not confuse it.
Thanks to everyone who looked at this for me.
source to share
Well, I said that I had no experience with XML, and that it was not easy to prove it.
For the server, I ended up with this ...ls.php?wsdl&test
, but I had to remove the wsdl from it and only had...ls.php?test
Another stumbling block was the variable type for myHTTP. I had it like MSXML2.XMLHTTP60
, but I believe it blocks the response as a security measure for cookies. After making changes to it WinHttp.WinHttpRequest
, it looks like this is the trick.
source to share