Ajesh
6th March 2019, 17:29
Hi All

I am trying to use Web Services as mentioned in the programmers Guide
But its giving me status 7, i.e after the soap.invoke call..


long msgNode
long requestNode
long responseNode
long methodNode
long status
string zip( 64 )
string result( 128 )

zip = "10001"

| Create a new SOAP message
msgNode = soap.newMessage( URI_SOAP11 )

| Define the method to call
requestNode = xmlNewnode( "GetInfoByZIP" )
| Set the default namespace
xmlSetAttribute(requestNode, "xmlns", "http://www.webserviceX.NET" )
xmlNewDataElement( "USZip", zip, requestNode )

| Add the method to the SOAP envelope contained the in the SOAP message
soap.addMethod( msgNode, requestNode )

| Set the SOAP Action
soap.setAction( msgNode, "http://www.webserviceX.NET/GetInfoByZIP" )

| Invoke the SOAP request
status = soap.invoke( msgNode,
"http://www.webservicex.net:500/Prices?ticker=CCRETT01ATA661N", responseNode )

| Check the response
if status = 0 then
| Get the method result
methodNode = soap.getMethod( responseNode )
result = xmlDataElement$( methodNode, "GetInfoByZIPResult" )
else
| Something went wrong...
message( "SOAP Error: %d", status )
endif

| Cleanup
soap.deleteMessage( msgNode )
soap.deleteMessage( responseNode )



Any Clue?

bhushanchanda
7th March 2019, 16:57
Hi Ajesh,


The WebServiceX.Net website has been updated so probably the webservices and their web methods might also have changed. So, please verify if the webservices are working fine.


You can test the webservices by using S/W like SOAPUI.



Also, here's a thread (http://www.baanboard.com/baanboard/showthread.php?t=64167)which you can refer and see if that works for you.

~Vamsi
7th March 2019, 18:08
I think you may have a proxy that you haven't accounted for.

See error codes here:
https://curl.haxx.se/libcurl/c/libcurl-errors.html