Built-in Support for XML Web Services (OpenInsight 32-Bit)
At 01 JUN 2006 11:22:10PM Tony Lillyman wrote:
I have to answer this question in respect to OI.
4. Does this platform (OI) include built-in support for the consumption of XML Web Services?
Can anyone provide and answer and also enlighten me on how this might be achieved.
Thanks in Advance
Tony
At 05 JUN 2006 12:53AM Bob Carten wrote:
The short anwswer is that there is not built-in support for consuming web services.
Consuming a web service usually involves sending a POST request to the service using the postwebpage routine, then parsing the reponse.
This is doable, the trick is to get the WSDL file and determine the correct format for the payload you need to send to the web server.
Microsoft created a COM object which does a lot of the work for you.
While it is deprecated in favor of .Net, it works quite well. Given the OLE functionality in OI 7.21, you can use the MS toolkit to consume web services Below is an example:
function Soap_Call_Example(City)
/*
Consume a web service using MSSOAP toolkit The example web service whas eather For two cities
OpenInsight version 7.21
rjc 06-05-2006 Created
**
*/
ans='
If Assigned(city) Else city='
If city=' Then
city=Istres'End
Location of the web service url=http://www.severalways.org/WS/BerreWeather/BerreWeather.php?wsdl" Create the COM object
oSOAP=OleCreateInstance("MSSOAP.SoapClient")
Connect to the service x= OleCallMethod(oSOAP, 'mssoapinit', url) Call the GetWeather Service
oResults=oSoap-]GetWeather("Istres")
The service returns an array of values (really a set of XML Nodes) Convert to an FM / VM delimited array of Name/value pairs
cnt=oResults-]Length
For i=0 To cnt-1
oResult=oResults-]Item(i)ans[i]=oResult-]NodeName : @vm : oResult-]TextNext
Return ans
At 05 JUN 2006 03:52AM Tony Lillyman wrote:
Thanks Bob
Much appreciate the explanation of this process.
It is VERY new concept to me, but as with most things OI/Windows
I expected that it could be done. So much I dont understand about the interfacing to Windows/Web services etc.
Regards
Tony