From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a diadem web service client from a WSDL file?

 
0 Kudos
Message 1 of 3
(4,557 Views)

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")

0 Kudos
Message 2 of 3
(4,549 Views)

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.

0 Kudos
Message 3 of 3
(2,159 Views)