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?
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?