Read received xml webservice

lyot
Member Posts: 202
I'm sending the following file to webservice in NAV2009 (codeunit I published).
I limited the quantity of customerfields in this example, but in fact all should be send.
Defining every customer field as a receive parameter isn't quite the way to go.
Everything between<XmlFile>...</XmlFile> is in fact the 'payload' of my soap message.
But I don't find a way to process is on the receiving webservice, what kind of datatype should I use for receiving parameter?
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CustomerUpdate xmlns="urn:microsoft-dynamics-schemas/codeunit/WebserviceListener"> <XmlFile> <Customer Action="Insert"> <No.>1</No.> <Name>test klant</Name> <Search_Name>TEST KLANT</Search_Name> <Name_2/> <Address>a</Address> <Address_2/> <City/> <Contact/> <Phone_No./> <Telex_No./> <Our_Account_No./> </Customer> <Customer Action="Insert"> <No.>2</No.> <Name>Nog een klant</Name> <Search_Name>NOG EEN KLANT</Search_Name> <Name_2/> <Address/> <Address_2/> <City/> <Contact/> <Phone_No./> <Telex_No./> <Our_Account_No./> </Customer> </XmlFile> </CustomerUpdate> </soap:Body> </soap:Envelope>
I limited the quantity of customerfields in this example, but in fact all should be send.
Defining every customer field as a receive parameter isn't quite the way to go.
Everything between<XmlFile>...</XmlFile> is in fact the 'payload' of my soap message.
But I don't find a way to process is on the receiving webservice, what kind of datatype should I use for receiving parameter?
0
Answers
-
Hi,
You should use a XMLPort as your receiving parameter. Take a look at this http://community.dynamics.com/blogs/nav ... 44436.aspx
\Jonas0 -
-
Still got a small question/problem.
The xmlport on the receiving side will it receive the entire soap xml?<?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CustomerUpdate xmlns="urn:microsoft-dynamics-schemas/codeunit/WebserviceListener"> ...
Or just the 'payload' part.<XmlFile> <Customer Action="Insert"> ... </Customer> </XmlFile>
0 -
sanoj wrote:Hi,
You should use a XMLPort as your receiving parameter. Take a look at this http://community.dynamics.com/blogs/nav ... 44436.aspx
\Jonas
Thanx to Wireshark I have been able to capture the structure of send soapmessage<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <ImportDim xmlns="urn:microsoft-dynamics-schemas/codeunit/DimensionImport"> <dimImport> <Dimension xmlns="urn:microsoft-dynamics-nav/xmlports/DimensionImport"> <DimensionCode>AREA</DimensionCode> <Code>HELA</Code> <Name>BA</Name> </Dimension> </dimImport> </ImportDim> </soap:Body> </soap:Envelope>
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