send big XML Files

gkservicegkservice Member Posts: 9
Hello,

we have the Problem that we can sucessfully write big xml-Files and also read them, but we can NOT send them via a webservice. We receive the message that the length of the string is longer then the length of the buffer.

Does someone have a Idea for us?
IF ISCLEAR(XMLHttp) THEN
  CREATE(XMLHttp);

IF ISCLEAR(XMLDoc) THEN
  CREATE(XMLDoc);

rShippingAgent.GET(rParcelShipment."Shipping Agent");

XMLHttp.open('POST', rShippingAgent.Webservice, 0);
XMLHttp.setRequestHeader('SoapAction', rShippingAgent."Operation - Shipment");
XMLHttp.setRequestHeader('Content-Type', 'text/xml; charset-utf-8');
XMLHttp.setRequestHeader('Connection', 'keep-alive');
XMLHttp.setRequestHeader('Keep-Alive', 'timeout=30, max=1000');

RequestFile.OPEN(RequestFilePath);

RequestFile.CREATEINSTREAM(InFilestream);
XMLDoc.load(InFilestream);

XMLHttp.send(XMLDoc.xml);

IF XMLHttp.status <> 200 THEN
  MESSAGE('Http Error' + ' ' + FORMAT(XMLHttp.status) + ': ' + XMLHttp.statusText);

XMLDoc.async:=FALSE;
XMLDoc.load(XMLHttp.responseBody);
XMLDoc.save(rWarehouseSetup.Transactionfolder + '\RX_' + FORMAT(Shipment) + '.xml');

Answers

  • ta5ta5 Member Posts: 1,164
    Hi
    I suppose it works if you send the same file type but with less records. If possible, you should check with the persons responsible for that web service.
    Hope this helps
    Thomas
  • gkservicegkservice Member Posts: 9
    Cutting it to 1024 is not a solution....
    ta5 wrote:
    Hi
    I suppose it works if you send the same file type but with less records. If possible, you should check with the persons responsible for that web service.
    Hope this helps
    Thomas
    My Testfile does have 5200chars.
  • ta5ta5 Member Posts: 1,164
    Did you talk to the webservice guys?
  • gkservicegkservice Member Posts: 9
    ta5 wrote:
    Did you talk to the webservice guys?
    yes... and they said we can not limit this
  • ta5ta5 Member Posts: 1,164
    :?: Ok, but if your system has to use an existing ws, this service should be able to handle that data!? Imo either their service is not sufficient or your data do not match their specification...
  • gkservicegkservice Member Posts: 9
    ta5 wrote:
    :?: Ok, but if your system has to use an existing ws, this service should be able to handle that data!? Imo either their service is not sufficient or your data do not match their specification...
    sorry, but there may be some missunderstanding....
    The File I produce is correct, and if I use for example "soapui" I can send this and get a correct response...only Navision can not send this file, cause it has more the 1024 chars
  • ta5ta5 Member Posts: 1,164
    Ok, misunderstanding. At what line do you get the error? Error could be from the return value of the automation object...
  • gkservicegkservice Member Posts: 9
    ta5 wrote:
    Ok, misunderstanding. At what line do you get the error? Error could be from the return value of the automation object...
    here:
    XMLHttp.send(XMLDoc.xml);
    
  • piktazpiktaz Member Posts: 9
    Try
    XMLHttp.send(XMLDoc);
    

    And if that don't work change to 'Microsoft XML, v6.0'.ServerXMLHTTP and try example below:
    XMLHTTPSrv.open('POST',WSURL,FALSE); 
    XMLHTTPSrv.setRequestHeader('Content-Type','text/xml');
    XMLHTTPSrv.setRequestHeader('SOAPAction',WSACTION);
    XMLHTTPSrv.send(XmlDoc);
    
  • gkservicegkservice Member Posts: 9
    Thanks, this solved this issue.
    piktaz wrote:
    Try
    [code]
    XMLHttp.send(XMLDoc);
    [code]
Sign In or Register to comment.