Hi all,
I'm facing an issue that drive me crazy, I hope I can find the answer among all you experts.
We are running NAV2009R2 with a Navision Application server that run as a windows service.
When we do import documents via NAS, sometimes, the import just freeze in the job queue with status "In progress", to solve that, we do restart the NAS windows service and then the import continues. When I restart the service, I get "Error 109, The Pipe has been ended".
Added some log lines in the code to see where it stopps. I can see it always stopps at "rRequest.Data.CREATEOUTSTREAM(RequestOutStream)"
Along with the import, we do a SOAP request in a separate codeunit where the code execution freezes.
rDataLog.INSERT(TRUE);
Dlg.Update(4, 'Create SOAP request...');
SLEEP(10);
CLEAR(btSoapEnvelope);
btSoapEnvelope.ADDTEXT('<?xml version="1.0" encoding="utf-8"?>');
btSoapEnvelope.ADDTEXT('<soapenv:Envelope ');
.
.
btSoapEnvelope.ADDTEXT('<soapenv:Header>');
.
.
btSoapEnvelope.ADDTEXT('</soapenv:Header>');
btSoapEnvelope.ADDTEXT('<soapenv:Body>');
.
.
btSoapEnvelope.ADDTEXT('</soapenv:Body>');
btSoapEnvelope.ADDTEXT('</soapenv:Envelope>');
rRequest.Data.CREATEOUTSTREAM(RequestOutStream);
btSoapEnvelope.WRITE(RequestOutStream);
rRequest.Data.CREATEINSTREAM(RequestInStream);
xmlhttp.open('POST', 'https:\\soapEndPoint');
xmlhttp.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xmlhttp.setRequestHeader('SoapAction', rType."Soap Action");
xmlhttp.send(RequestInStream);
xmlhttp.waitForResponse(500);
Dlg.Update(4, 'Wait for an answer...');
SLEEP(10);
xmldomResponse4 := xmlhttp.responseXML;
xmldomResponse4.save(ResponseOutStream);
rDataLog.Response.CREATEOUTSTREAM(osResponse);
xmldomResponse3.save(osResponse);
rDataLog.MODIFY;
COMMIT;
The strange thing is there are two companies in the same database. And the problem occurs only in one of them.
The problem occurs usually along with heavy import. There is no problem with few documents but when NAS import too many documents, the probability is much higher that the problem will occur.
What I tried:
* Uninstall NAS service and reinsall it.
* Create a new service user and changed the user running the NAS service.
* Checked any deadlocks in the database. Using extended events and SQL profiler.
* Followed the SOAP request using Wireshark and Fiddler.
* Used Process monitor to see if there are any thread block.
* Checked Event Viewer.
None of the above showed any hint where is the problem.
Googled a lot and the most similar case is here:
https://forum.mibuso.com/discussion/49235/nas-getting-stuck-when-ran-as-service
The common thing is that the user has proxy settings in internet options.
Any idea, hint?
Answers
Maybe it could be related to your NAV 2009R2 version. Are you on build 6.0.38655 ?
We actually have all documents in one file, and will be a bit harder to separate it apart. But yes, I agree, it's a work-around.
Version we use: 6.00.32942.
You could try to use an XML Document instead an OutStream/Instream and see what happens.
I mean this type of variable
You can create the SOAP document with that variable and send it the same way you are doing now.
Regards.
The XMLDoc also didn't work ?
Regards.