Hi
Can you guys please help with some SOAP/HTTPSocket webservice question as I’m new to XOJO .I have to communicate with third party soap webservice with my XOJO application.
Third Party wsdl has 4 operations and need to call one after another. So my focus is how to call the first operation for the time being.
Its takes XML as a request and returns XML response if I try the same in web browser.
I have used HTTPSocket and my res is giving faultstring
step 1 wsdlAddress for wsdl address
step 2 result for the output of HTTPSOCKET.post XMLDocument type
step 3 Creating HTTPSocket variable
step 4 SetRequestHeader for the soap action for one of the methods in wsdl // can you please cross check if the order or the syntax is not wrong
step 5 SetRequestContent for xmldic which a xml document created as per requirements and type which is xml.
the same xml doc is working on web browser setup.
step 6 result is populated with the output response of HTTPSOCKET.post
Dim wsdlAddress as String = “http://…wsdl”
Dim result as XmlDocument
Dim sock as New HTTPSocket
sock.SetRequestHeader(“SOAPAction”, “Method1”)
sock.SetRequestContent(xmldoc.ToString,"text/xml) //xmldoc is an xml document created as per requirement
result = New XmlDocument(sock.Post( wsdlAddress,20 ))
The same xml request is working on web browser but not in my software. Can I please know what im missing here or doing anything wrong?
Thanks in advance
Thanks for the quick reply Christian , much appreciated!
Unfortunately whatever the value of soapaction is in my wsdl if i’m trying to use the same, its also giving me error. My soapaction looks like this
I also never assume that the response is going to be xml… if there is a problem on the server you might get html resulting in an exception when you load it into an xmldocument.
Jean - Thank u so much, actually i’m just few months old to XOJO and no idea about PAW. Will look into this and get back if any success or failure.
James - Thank you so much for the reply
If I do not need sock.SetRequestHeader(“SOAPAction”, “Method1”) , then is there any other way to specify which method/operation I wanted to call as there 4 sets of operations in the same WSDL and in my requirent i have to call one after another.
Yes the response is string which i’m using it to create xmldocument.
Jean/james/Christian - Any pointers to SOAPAction value after seeing my wsdl
James
for my request i’m also creating something similar which is working on SOAPUI
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:urn=“urn:schemas-iwaysoftware-com:iwse” xmlns:urn1=“urn:iwaysoftware:ibse:jul2003:Method1”> soapenv:Body urn1:Method1
</urn1:Method1>
</soapenv:Body>
</soapenv:Envelope>
But if I give same method name in xojo it gives me error
sock.SetRequestHeader(“SOAPAction”, “Method1”)
You might want to get a copy of Oxygen (https://www.oxygenxml.com/xml_editor/wsdl_soap_analyzer.html)… Its WSDL analyzer will give you exactly what you need to get it to work. It is not cheap but they have a 30 day free trial. I find it invaluable for not only SOAP but anything related to xml.
James Thanks for recommending Oxygen - it is very helpful to analyse wsdl
its giving me all details of wsdl like URL, SOAP Action, Services, Ports, Operations
I’m giving the same SOAPAction value but doesnot seem to work.
In one of your previous answers you also mentioned that I don’t need sock.SetRequestHeader(“SOAPAction”, “Method1”)
So ihave tried with
responsestring = sock.SendRequest(“Method1”,Addresswsdl,20)
and I got responsestring as 503 - Service Unavailable
Looks like there URL is not accessible. I have sent email to third party to make URL available to me.
Still trying my best to make it work