Webservice method getting null parameters
Bogdan9119
Member Posts: 14
When I call my webmethod from browser it runs okay and gives results, but when called from NAV 2017 all passed arguments are null. This is the xml http request I generate from NAV:
And that's the request in browser, which works:
I think it could be related to namespaces of child elements inside BarcodePrintZpl . If I set the namespace for BarcodePrintZpl then all child nodes get some default empty namespace. When I try to remove the default namespace with removeAttribute('xmlns') it's still there. Can you help me?
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <BarcodePrintZpl> <user>testuser</user> <variablesString>testvars</variablesString> <filepath>testfile</filepath> <printerName>testprinter</printerName> </BarcodePrintZpl> </soap:Body> </soap:Envelope>
And that's the request in browser, which works:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<BarcodePrintZpl xmlns="http://tempuri.org/">
<user>string</user>
<variablesString>string</variablesString>
<filepath>string</filepath>
<printerName>string</printerName>
</BarcodePrintZpl>
</soap:Body>
</soap:Envelope>
I think it could be related to namespaces of child elements inside BarcodePrintZpl . If I set the namespace for BarcodePrintZpl then all child nodes get some default empty namespace. When I try to remove the default namespace with removeAttribute('xmlns') it's still there. Can you help me?
0
Answers
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Try by including the encoding scheme too in your XML request.Best Regards:
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.0 -
A namespace is not just an attribute. I don't quite get what you do and where you do it when you say "I try to remove the default namespace with removeAttribute('xmlns')"
Anyway, stick to the schema given by the WSDL document, including namespaces, and use the proper methods, parameters or properties for namespaces. Don't define them as attributes, unless you create the whole request as text.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
