Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web service object doesn't have the methods it should
Message
From
11/05/2018 16:48:45
 
 
To
11/05/2018 14:51:41
General information
Forum:
Visual FoxPro
Category:
Web Services
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01659917
Message ID:
01659941
Views:
91
This message has been marked as the solution to the initial question of the thread.
Likes (1)
>>>Hi all.
>>>
>>>I have a "simple" project which has to integrate a Web Service into an existing VFP 9 application. I was given the url of the WS. I registered the URL int VFP's Toolbox, and then I dragged the registered WS from the ToolBox to an empty PRG window. It created all the necessary stuff to begin programming with the ws object, intellisense even shows the methods it should have (first attached file). But when I run the PRG, the ws object gives me an error which says that the WS object doesn't have the method I tried to use in code. So I run again the prg and stop it before executing the line where I make the method call, then, in the command window I typed the WS object name followed by the dot so I let intellisense show me the methods it has, but, to my surprise I see other methods (second figure), none of them are the ones that are supposed to be.
>>>
>>>Has anyone dealt with this kind of problem? Any help would be appreciated.
>>>
>>>TIA
>>
>>Luis
>>
>>This won't be much of a help, since I don't have a recent experience on the VFP's SOAP client class (I don't even have the SOAP toolkit installed in my current machine), but I would guess that the difference in the PEM lists comes from the context given by the __VFPWSDef__ in the generated code, which may be lost in the command line.
>>
>>As for the Web Service consumption, you may consider to call the Web Service directly or to use an alternative client class (like West Wind Internet & Client Tools).
>
>How should I call the Web Service directly? I'd rather use free tools since this little project's budget doesn't take into account a paid tool. Thank you.


Not completely sure about a successful result, but this won't put you too far away from what is needed to consume the WS.
LOCAL CodCliente AS String
LOCAL DocExterno AS String

LOCAL SOAPRequest AS String
LOCAL SOAP AS MSXML2.ServerXMLHTTP60
LOCAL XML AS MSXML2.DOMDocument60

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

* fill for a real query
m.CodCliente = ""
m.DocExterno = ""

TEXT TO m.SOAPRequest NOSHOW TEXTMERGE
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://service.bbvaimportar.olva.com/">
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <ns0:getByDocExterno>
      <txtCodCliente><<m.CodCliente>></txtCodCliente>
      <docExterno><<m.DocExterno>></docExterno>
    </ns0:getByDocExterno>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ENDTEXT

m.SOAP.Open("Post", "http://ws.olvacourier.com:8080/bbvaimportar/TrackingService", .F.)
m.SOAP.SetRequestHeader("Content-type", "text/xml")

m.SOAP.Send(m.SOAPRequest)

m.XML = m.SOAP.Responsexml

m.XML.setProperty("SelectionNamespaces", 'xmlns:olva="http://service.bbvaimportar.olva.com/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"')

IF m.XML.selectNodes("//soap:Fault").length != 0
	XMLTOCURSOR(m.XML.selectNodes("//soap:Body").item(0).xml, "result")
ELSE
	XMLTOCURSOR(m.XML.selectNodes("//olva:getByDocExternoResponse").item(0).xml, "result")
ENDIF

BROWSE
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform