09-08-2008 02:16 AM
09-08-2008 07:58 AM
Please find below a little example. It's very basic and the details are specific for the webservice. In general all you need are the two lines marked in blue. The example doesn't have any error checking. I recommend to add at least some basic functionality to check whether the service is available.
Andreas
'-------------------------------------------------------------------------------
' Example showing how to use a webservice from VBS
'-------------------------------------------------------------------------------
Dim oSoapClient,objXML,sgResponse,oRoot,oNodes,oChildNode,I,sgLog
Set oSoapClient = CreateObject("MSSOAP.SoapClient")
Set oXMLDOM = CreateObject("Microsoft.XMLDOM")
' create SOAP wrapper for webservice
Call oSoapClient.mssoapinit("http://www.webservicex.com/stockquote.asmx?WSDL")
' Get quote for NATI stock. Data is formatted as XML/DOM strcuture
sgResponse = oSoapClient.GetQuote("NATI")
' Parse XML
oXMLDOM.LoadXML(sgResponse)
' List properties
Set oRoot = oXMLDOM.documentElement
' Parse property nodes
Set oNodes = oRoot.childNodes.Item(0)
sgLog = ""
For Each oChildNode In oNodes.childNodes
sgLog = sgLog &oChildNode.baseName&" : "&oChildnode.text & vbCR
Next
Call MsgBox(sgLog,,"Data for NATI")
09-12-2019 02:04 AM - edited 09-12-2019 02:13 AM
Is this functionality still available in 2019? Executing this code with DIAdem 2019 gives the error message: "ActiveX component can't create object: MSSOAP.SoapClient". Maybe there is another way to send SOAP-requests with the current version? Kind regards.