Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using web service
Message
From
05/11/2020 05:48:29
 
 
To
30/09/2020 18:46:27
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
01676303
Message ID:
01677030
Views:
72
I finally got username and password. Tried your example and coudn't compile in vfp6. Is there some easiest way to get result from wsdl? Something like

o = createobject("MSSoap.SoapClient30")
o.mssoapinit("https://webapp2.rzzo.rs/rzzo/RzzoService?wsdl")

How to pass username and password to wsdl? When I execute mssoapinit, an error appears about (among other lines :-( ) loading of the wsdl failed.

I'm still with zero success in web services area :-).



>Thanks, I'l try.
>
>I dont understand part of sharing WSDL URL? If you need url for some additional help to me :-) there is it
>
>https://webapp2.rzzo.rs/rzzo/RzzoService?wsdl
>

Zoran, this URL points to the description of the service.

Now, a basic VFP program to contact the service and look for the connection status (CheckConnection is one of the operations of the Web Service, as described in its WSDL):
LOCAL SOAP AS String

LOCAL UserName AS String
LOCAL UserPassword AS String

m.UserName = "Zoran"
m.UserPassword = "demo"

TEXT TO m.SOAP FLAGS 1 TEXTMERGE
<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"><<TTOC(DATETIME(), 3)>></wsu:Created>
   </wsse:UsernameToken>
  </wsse:Security>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
  <ns0:CheckConnection/>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ENDTEXT

LOCAL HTTP AS MSXML2.ServerXMLHTTP60
LOCAL Response AS MSXML2.DOMDocument60
LOCAL Nodes AS MSXML2.IXMLDOMNodeList

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

MESSAGEBOX("Connection: " + m.Response.selectNodes("//RZ:CheckConnectionResponse/return").item(0).text)
Obviously, the service returns an Error: Authentication of Username Password Token Failed, which is ok because I just made up a username and password for testing. There are a few details that I'm not sure on how they must be addressed, mainly concerning authentication, but I believe that you'll have documentation about that and this snippet may eventually serve as a starting point.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform