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
0
Comments
Peter Wibeck
Software Development Engineer in Test
Dynamics NAV Server and Installer team
http://blog.wibeck.org/