Connect to external webservice

birre
Member Posts: 22
Hi,
I need to connect to an external webservice that has these specifications:
I'm trying to connect to the webservice with this code:
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?
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?
0
Comments
-
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.
Thoomas0 -
you need to create xml document for pass these parameters.
try it will definitely resolve your issue.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions