Problem with XML HTTP response
dipke
Member Posts: 2
We have a codeunit which sends out an XML HTTP request and receives the response into an XML document. Up to now this was working great.
...
IF ISCLEAR(aut_XmlHttp) THEN CREATE(aut_XmlHttp);
aut_XmlHttp.open('POST', txc_PostURL, FALSE);
aut_XmlHttp.setRequestHeader('Content-Type', 'text/xml');
aut_XmlHttp.send (ism_XML);
// Handle XML Response
IF (aut_XmlHttp.statusText = 'OK') THEN BEGIN
// Save HTTP response in XML document object
IF ISCLEAR(aut_XmlDoc) THEN CREATE(aut_XmlDoc);
aut_XmlDoc := aut_XmlHttp.responseXML;
...
Recently we have noticed that in some cases, the responseXML contains the "°" character. When this character is found, the XML parser says an invalid character is found, causing the XML document to be empty.
I tried to read out the responseText (which is working great in VB), but Navision always gives the error that the text is too long for the input buffer. I have made sure to create a text variable with a length of 1024 characters, while the responseText is at most 750 characters. So it should fit. I noticed that when the length is less than 250 characters everything works fine.
Is there a way around this problem? TIA!!
...
IF ISCLEAR(aut_XmlHttp) THEN CREATE(aut_XmlHttp);
aut_XmlHttp.open('POST', txc_PostURL, FALSE);
aut_XmlHttp.setRequestHeader('Content-Type', 'text/xml');
aut_XmlHttp.send (ism_XML);
// Handle XML Response
IF (aut_XmlHttp.statusText = 'OK') THEN BEGIN
// Save HTTP response in XML document object
IF ISCLEAR(aut_XmlDoc) THEN CREATE(aut_XmlDoc);
aut_XmlDoc := aut_XmlHttp.responseXML;
...
Recently we have noticed that in some cases, the responseXML contains the "°" character. When this character is found, the XML parser says an invalid character is found, causing the XML document to be empty.
I tried to read out the responseText (which is working great in VB), but Navision always gives the error that the text is too long for the input buffer. I have made sure to create a text variable with a length of 1024 characters, while the responseText is at most 750 characters. So it should fit. I noticed that when the length is less than 250 characters everything works fine.
Is there a way around this problem? TIA!!
0
Comments
-
AJAX for Navision? Wow!

Your problem is quite stange. You might try to use a BigText field in a virtual table...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
- 322 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