XML File Signature

weneed
Member Posts: 82
I need to send an XML file created with XML Port object to an external web service. Webservice verify file signature to check real file format.
It expects to receive an xml file with the first 5 bytes set like this:
0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20
but file created from BC contain file text signature: ef bb bf or ff fe 3c 20 3f 20
This is wikipedia link
So why BC does it create xml files without the correct signature?
It expects to receive an xml file with the first 5 bytes set like this:
0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20
but file created from BC contain file text signature: ef bb bf or ff fe 3c 20 3f 20
This is wikipedia link
So why BC does it create xml files without the correct signature?
0
Best Answer
Answers
-
Hello @weneed,
ef bb bf
is that the file is UTF-8 BOM https://en.wikipedia.org/wiki/Byte_order_mark
And
ff fe
is that the file is UTF-16.
How do you create the XML file ??
Regards.0 -
That external web service does not adhere to the xml specification. See here: https://w3.org/TR/REC-xml/#sec-guessing
Neither does Microsoft, as it is recommended to not use a BOM for XML.
When I last checked, I was unable to write an xml file without BOM using an Unicode encoding and tools available in Dynamics NAV / BC.
You will have to post-process your file (or stream) in order to remove the BOM.0 -
I' using XMLport with Format property set to XML
0 -
Thanks I hadn't noticed that0
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