Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using web service
Message
De
23/11/2020 04:59:43
 
 
À
19/11/2020 10:11:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Divers
Thread ID:
01676303
Message ID:
01677283
Vues:
83
Today is a first day a got access to PC with access to web services to try. It works. As a result of

m.XMLData = m.Response.selectNodes("//RZ:GetInsuranceDataFResponse/return").item(0)
MESSAGEBOX("InsuranceDataF: " + m.XMLData.text)

I got a long string with valid data. Question is how to determine where is a delimiter in that string to separate data? Is there a way to find out description of data in that string?

Again, thanks a loz for your help.



>It works :-)! Message is "connectin : true!"
>
>Finally, how to call function GetInsuranceDataF with "lbo" as parameter?
>I suppose result is XML file which I can manage with for example
>STRTOFILE(lcXML, "aaa.txt")
>
>Thanks in advance.
>

Zoran,

This is how you could call the function. As you can see, there is lots of code and setup quite similar to the connection check, so obviously there will be room for code consolidation. This serves just as a general guideline on how to do it.
LOCAL SOAP

LOCAL UserName
LOCAL UserPassword
LOCAL Now

m.UserName = "Zoran"
m.UserPassword = "demo"
m.Now = TRANSFORM(TTOC(DATETIME(), 1), "@R 9999-99-99T99:99:99")

LOCAL Lbo
LOCAL Zk

m.Lbo = "insert parameter value here"
m.Zk = "insert parameter value here"

SET TEXTMERGE TO "SoapCall.xml"
SET TEXTMERGE ON

TEXT
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://service.rzzo.rs/">
 <SOAP-ENV:Header>
  <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
   <wsse:UsernameToken>
    <wsse:Username><<m.UserName>></wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"><<m.UserPassword>></wsse:Password>
    <wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><<m.Now>></wsu:Created>
   </wsse:UsernameToken>
  </wsse:Security>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
  <ns0:GetInsuranceDataF>
   <req>
    <lbo><<m.Lbo>></lbo>
    <zk><<m.Zk>></zk>
   </req>
  </ns0:GetInsuranceDataF>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ENDTEXT

SET TEXTMERGE TO

m.SOAP = FILETOSTR("SoapCall.xml")

LOCAL HTTP
LOCAL Response
LOCAL Nodes
LOCAL XMLData

m.HTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")

m.HTTP.Open("Post", "https://webapp2.rzzo.rs:443/rzzo/RzzoService", .F.)
m.HTTP.Send(m.SOAP)

m.Response = m.HTTP.ResponseXML

m.Response.SetProperty("SelectionNamespaces", 'xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" ' + ;
	' xmlns:RZ="http://service.rzzo.rs/"')

m.Nodes = m.Response.selectNodes("/SOAP:Envelope/SOAP:Body/SOAP:Fault")
IF m.Nodes.length > 0
	MESSAGEBOX("Error: " + m.Nodes.item(0).selectNodes("faultstring").item(0).text)
	RETURN
ENDIF

m.XMLData = m.Response.selectNodes("//RZ:GetInsuranceDataFResponse/return").item(0)

MESSAGEBOX("InsuranceDataF: " + m.XMLData.text)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform