Consuming NAV webservice through proxy

livingdoll
Member Posts: 45
Hi,
I've published a webservice with which a new customer can be inserted in another company. The method in the webservice is called InsertCustomer and has the following parameters: CompanyNo and CustData. CompanyNo is an integer and CustData is xmlport 50004 (called XMLImportCustomer). The xmlport variable is referenced byVar, so the function should accept xml that will be processed by that specific xmlport. I use a proxy dll created in visual studio, so that I am able to consume this webservice from another company in NAV with means of dotnet interop.
The only issue left is the syntax:
I thought I could call this function from NAV with the following syntax (the xml string is simplified for means of readability):
InsertCustomer(1,'<customer><code>1</code><name>c.lient</name></customer>')
so that the xml string was picked up and processed by the xml port automatically. However, Nav does not like this. On compiling, I get the error message:
'Type conversion is not possible because 1 of the operators contains an invalid type. DotNet := Text'.
Apparently, the function expects a DotNet variable instead of a xml-string. Does anyone have some suggestions on how to call this function properly?
Thanks in advance.
Josh
I've published a webservice with which a new customer can be inserted in another company. The method in the webservice is called InsertCustomer and has the following parameters: CompanyNo and CustData. CompanyNo is an integer and CustData is xmlport 50004 (called XMLImportCustomer). The xmlport variable is referenced byVar, so the function should accept xml that will be processed by that specific xmlport. I use a proxy dll created in visual studio, so that I am able to consume this webservice from another company in NAV with means of dotnet interop.
The only issue left is the syntax:
I thought I could call this function from NAV with the following syntax (the xml string is simplified for means of readability):
InsertCustomer(1,'<customer><code>1</code><name>c.lient</name></customer>')
so that the xml string was picked up and processed by the xml port automatically. However, Nav does not like this. On compiling, I get the error message:
'Type conversion is not possible because 1 of the operators contains an invalid type. DotNet := Text'.
Apparently, the function expects a DotNet variable instead of a xml-string. Does anyone have some suggestions on how to call this function properly?
Thanks in advance.
Josh
0
Comments
-
http://dynamicsuser.net/forums/p/32432/170176.aspx could give you some ideas.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Peter Wibeck
Software Development Engineer in Test
Dynamics NAV Server and Installer team
http://blog.wibeck.org/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