Connect to external webservice

birrebirre Member Posts: 22
Hi,

I need to connect to an external webservice that has these specifications:

-<Function name="FunctionName">
-<Url>
<Protocol>https</Protocol>
<Server>serveraddress.com</Server>
<Path>/v1/path.asmx/FunctionName</Path>
<Port>443</Port>
</Url>
-<Parameters>
<Var name="var1" server="var1"/>
<Var name="var2" server="var2"/>
<Var name="var3" server="var3"/>
</Parameters>
</Function>


I'm trying to connect to the webservice with this code:
IF ISCLEAR(WinHttpRequest) THEN CREATE(WinHttpRequest);
IF ISCLEAR(XMLDoc) THEN
  CREATE(XMLDoc);

WinHttpRequest.Open('POST',ltxtUrl,FALSE);
WinHttpRequest.SetAutoLogonPolicy(0);
WinHttpRequest.SetCredentials(httpUsername,httpPassword,0);
WinHttpRequest.SetRequestHeader('var1',FORMAT(txtVar1);
WinHttpRequest.SetRequestHeader('var2',txtVar2);
WinHttpRequest.Send(XMLDoc);
IF NOT WinHttpRequest.WaitForResponse() THEN
  ERROR('Timed out'); 

XMLDoc.load(WinHttpRequest.ResponseBody);
XMLDoc.save(File);

The status returns 200, so that's good, but on the external side, the parameters aren't recognized. Is there any other way to specify them?

Comments

  • ta5ta5 Member Posts: 1,164
    Hi Birre
    IMO, at least if its a SOAP WS you are calling I guess you have to send your parameters within xmlDocument.
    Hope this helps.
    Thoomas
  • aniishaniish Member Posts: 27
    you need to create xml document for pass these parameters.
    try it will definitely resolve your issue.
Sign In or Register to comment.