how add encoding into xml for export

george175
Member Posts: 26
Hello everybody,
how can I add encode - into xml? :-) i need this - <?xml version="1.0" encoding="UTF-8"?>
from this <?xml version="1.0"?>
Iam using XML DOM Management for creating xml
<?xml version="1.0"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.teccom-eu.net/wsdl">
-<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:mustUnderstand="1">
-<o:UsernameToken xmlns:u="http://www.teccom-eu.net/wsdl" u:Id="uuid-441ec92f-002a-4c40-adea-a40eb7159b2e">
<o:Username>6790000000930</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TcCUser_2006!</o:Password>
</o:UsernameToken>
</o:Security>
-<SOAP-ENV:Body>
-<ProcessRequest>
<RequestElement> <FunctionCallRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
thx Everyone
how can I add encode - into xml? :-) i need this - <?xml version="1.0" encoding="UTF-8"?>
from this <?xml version="1.0"?>
Iam using XML DOM Management for creating xml
<?xml version="1.0"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.teccom-eu.net/wsdl">
-<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:mustUnderstand="1">
-<o:UsernameToken xmlns:u="http://www.teccom-eu.net/wsdl" u:Id="uuid-441ec92f-002a-4c40-adea-a40eb7159b2e">
<o:Username>6790000000930</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TcCUser_2006!</o:Password>
</o:UsernameToken>
</o:Security>
-<SOAP-ENV:Body>
-<ProcessRequest>
<RequestElement> <FunctionCallRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
thx Everyone
0
Answers
-
<?xml version="1.0" encoding="utf-8" ?>0
-
Remco_Reinking wrote: »<?xml version="1.0" encoding="utf-8" ?>
How can I insert encoding="utf-8" into xml header please?0 -
My answer was a bit short, but in stead of
<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sch.................
you should start it with<?xml version="1.0" encoding="utf-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sch..................
That's alll.0 -
Remco_Reinking wrote: »My answer was a bit short, but in stead of
<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sch.................
you should start it with<?xml version="1.0" encoding="utf-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sch..................
That's alll.
Yes, but problem is, that I need to put this automatically with function in NAV. I have to connect two system with web services and second one
requires encoding in xml header.
XMLDOMMgt create xml just with <?xml version="1.0"?> instead this <?xml version="1.0" encoding="utf-8" ?>0 -
XMLDeclaration := XmlDoc.CreateXmlDeclaration('1.0','UTF-8','');
XmlDoc.AppendChild(XMLDeclaration);
put this before root element
Name DataType Subtype Length
XMLDeclaration DotNet System.Xml.XmlDeclaration.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'1 -
In the XML DOM Management codeunit, there is a function called 'AddDeclaration' (Can't say if it's for all versions). You can use that one. It does just the same as what george175 mentioned:
XMLDOMMgt.AddDeclaration(XmlDoc,'1.0','UTF-8','');0 -
George,
Are you able to share your code? I'm trying to do the same but I don't have code which add ANY declaration. Even when I'm adding (or trying) it doesn't add it or errors...
I have tried to create node with 'processinginstruction' type, insertbefore function, createxmldeclaration, and few more but it still doesn't display what I want to.
Please help.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