XMLHTTP.send -> Text too long for the textbuffer
NavBoy13
Posts: 15
Hello, I want to send a xml file created in Navision with a xmlport to a webservice. i use the xmlhttp automation. This works fine for small xml files. When my xml file is 2 kb I get this error when the xmlhttp.send function is executed: The text is too long for the textbuffer.
When I open the XMl generated from the xmlport, I see that there are breaks after every line, is this the cause of the error? How can I remove them from the xml, it doens't work on my way...
Did anyone ever retrieved the same error? How did you solve it?
Tnx!
This is de code:
When I open the XMl generated from the xmlport, I see that there are breaks after every line, is this the cause of the error? How can I remove them from the xml, it doens't work on my way...
Did anyone ever retrieved the same error? How did you solve it?
Tnx!
This is de code:
//XML EXPORT
//-------------
IF XMLPORT.EXPORT(50009,lstrOutStream,lrecEloHeader) THEN BEGIN
ltmpBlob.Blob.CREATEINSTREAM(lstrInStream);
lautXml.load(lstrInStream);
lautXml.save('C:/Question.xml');
END ELSE BEGIN
ERROR('error:'+ GETLASTERRORTEXT);
END;
//XML send
//-------------
CREATE(locautXmlHttp);
CREATE(locautXmlResponse);
locautXmlHttp.open('POST','http://management.companyname.be/nav.php',TRUE);
locautXmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
locautXmlHttp.setRequestHeader('Connection', 'close');
//This line gives an error
//locautXmlHttp.send('navml='+lautXml.xml));
//So I want to remove al the breaks from the xml generated by the xmlport. I hope that this is the cause of the error.
lchr10 := 10;
lchr13 := 13;
intPos := STRPOS(FORMAT(lautXml.xml),FORMAT(lchr10));
WHILE intPos > 0
DO BEGIN
lbtxtXML := DELSTR(FORMAT(lautXml.xml),intPos,1);
intPos := STRPOS(lbtxtXML,FORMAT(lchr10));
END;
locautXmlHttp.send(FORMAT(lbtxtXML));
//RETRIEVE ANSWER
//-------------------
locautXmlResponse.load(locautXmlHttp.responseXML);
locautXmlResponse.save('C:\Response.xml');
0
Comments
-
Is there a limit of 1024 chars of the parameter?0
-
change your code to
locautXmlHttp.send(lautXml));0 -
to send your xml request, u can send text (like u do it), a file destination (like your stored xmlfile C:\myxmlfile.xml) or the automation lautXml self (because it has loaded the xmlfile)
Regards.Do you make it right, it works too!0 -
tnx guys, this works!0
-
you are welcome.0
Categories
- All Categories
- 75 General
- 75 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
