Hi,
I am using OpenEdge.Net.pl (Progress v11.5.1.006) for sending requests (base64-encoded Json into a SOAP envelopp) and getting randomly, from time to time, the following error :
'X-NODEREF or X-DOCUMENT LOAD got an error: FATAL ERROR: file 'MEMPTR', line '1', column '0', message 'invalid content after root element's end tag'. (9082)
I've execute the same code 50 times in a loop, and the error is thrown at the 7th, 34th and 46th iteration, but this change at each time I launch my loop (a 2nd time, I get error on iteration 18, 31 and 47).
This error seems to be thrown when I execute the request, and more exactly, when I receive the Http response.
I've checked my client log (with entry types activated), and the stack trace seems to be this :
The error is raised at : Write OpenEdge.Net.HTTP.Filter.Payload.XmlBodyResponseFilter @ 54) Progress.Lang.SysError
Looking at the source code of XmlBodyResponseFilter.cls, method Write, I can see this :
The Line 54 is the one doing the hDocument:load from the memptr.
I'm thinking of 2 things :
- Either my code calling OpenEdge.net is wrong (but it is working most of the time) or missing something (maybe a memory leak / object not properly deleted ?)
- or maybe this is a bug in OpenEdge.Net, in the XmlBodyResponseFilter.cls.
I'm new to work with WebServices and OpenEdge.Net.pl, so maybe I am missing something.
Any idea about where this error can come from ?
For information, here is my calling code, the one which is executed 50 times : the requests (Json + Soap) remains the same :
I am using OpenEdge.Net.pl (Progress v11.5.1.006) for sending requests (base64-encoded Json into a SOAP envelopp) and getting randomly, from time to time, the following error :
'X-NODEREF or X-DOCUMENT LOAD got an error: FATAL ERROR: file 'MEMPTR', line '1', column '0', message 'invalid content after root element's end tag'. (9082)
I've execute the same code 50 times in a loop, and the error is thrown at the 7th, 34th and 46th iteration, but this change at each time I launch my loop (a 2nd time, I get error on iteration 18, 31 and 47).
This error seems to be thrown when I execute the request, and more exactly, when I receive the Http response.
I've checked my client log (with entry types activated), and the stack trace seems to be this :
[18/05/23@15:23:58.518+0200] P-009012 T-009016 3 4GL 4GLTRACE Return from Write [OpenEdge.Net.HTTP.Filter.Payload.XmlBodyResponseFilter] ERROR
[18/05/23@15:23:58.518+0200] P-009012 T-009016 3 4GL 4GLTRACE Return from ExtractEntity [OpenEdge.Net.HTTP.Lib.ABLSockets.ABLSocketLibrary] ERROR
[18/05/23@15:23:58.533+0200] P-009012 T-009016 3 4GL 4GLTRACE Return from Execute [OpenEdge.Net.HTTP.Lib.ABLSockets.ABLSocketLibrary] ERROR
[18/05/23@15:23:58.533+0200] P-009012 T-009016 3 4GL 4GLTRACE Return from Execute [OpenEdge.Net.HTTP.HttpClient] ERROR
The error is raised at : Write OpenEdge.Net.HTTP.Filter.Payload.XmlBodyResponseFilter @ 54) Progress.Lang.SysError
Looking at the source code of XmlBodyResponseFilter.cls, method Write, I can see this :
Code:
method public void Write(input poData as Object):
define variable hDocument as handle no-undo.
define variable oData as class Memptr no-undo.
if not type-of(poData, Memptr) and
not type-of(poData, ByteBucket) then
return error new AppError(
substitute('Unsupported object type: &1', poData:GetClass():TypeName)
, 0).
assign oData = dynamic-invoke(poData, 'GetBytes':u).
create x-document hDocument.
hDocument:load('memptr':u, oData:Value, false).
assign moEntity = new WidgetHandle(hDocument).
end method.
The Line 54 is the one doing the hDocument:load from the memptr.
I'm thinking of 2 things :
- Either my code calling OpenEdge.net is wrong (but it is working most of the time) or missing something (maybe a memory leak / object not properly deleted ?)
- or maybe this is a bug in OpenEdge.Net, in the XmlBodyResponseFilter.cls.
I'm new to work with WebServices and OpenEdge.Net.pl, so maybe I am missing something.
Any idea about where this error can come from ?
For information, here is my calling code, the one which is executed 50 times : the requests (Json + Soap) remains the same :
Code:
BLOCK-LEVEL ON ERROR UNDO, THROW.
USING OpenEdge.Core.*.
USING OpenEdge.Net.HTTP.*.
USING OpenEdge.Net.HTTP.Lib.*.
USING Progress.Json.ObjectModel.*.
USING Progress.Lang.Object.
DEFINE INPUT PARAMETER ipiIterationRun AS INTEGER NO-UNDO.
DEFINE OUTPUT PARAMETER oplIterationResult AS LOGICAL NO-UNDO.
DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO.
DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO.
DEFINE VARIABLE oRequestBody AS WidgetHandle NO-UNDO.
DEFINE VARIABLE oLib AS IHttpClientLibrary NO-UNDO.
DEFINE STREAM dumpErr.
DEFINE VARIABLE lcSoapEnvelop AS LONGCHAR NO-UNDO.
DEFINE VARIABLE ptrJsonText AS MEMPTR NO-UNDO
DEFINE VARIABLE iErrorNum AS INTEGER NO-UNDO.
DEFINE VARIABLE cUrl AS CHARACTER NO-UNDO.
/************************************************ Main Block ************************************************/
oLib = ClientLibraryBuilder:Build()
:sslVerifyHost(NO)
:Library. /*Linrary initialization stuff*/
ptrJsonText = createJsonObject(). /*create the Json that the WebService expects*/
lcSoapEnvelop = createSoapEnvelop(ptrJsonText). /*create the Soap Envelop that the WebService expects, as a LongChar*/
oRequestBody = CreateXMLObject(lcSoapEnvelop). /*create the Soap Envelop that the WebService expects, transform it in a WidgetHandle object*/
cUrl = getWebServiceUrl(). /*WebService URL*/
oRequest = RequestBuilder:post(cUrl, oRequestBody) /*Build the request with the URL and the SOAP envelop containing the Json*/ :ContentType('text/xml;charset=UTF-8')
:AcceptJson()
:Request.
oResponse = ClientBuilder:Build()
:UsingLibrary(oLib)
:Client
:Execute(oRequest) NO-ERROR. /*'Excecute()' mthod is where the error is raised : "'X-NODEREF or X-DOCUMENT LOAD got an error: FATAL ERROR: file 'MEMPTR', line '1', column '0', message 'invalid content after root element's end tag'. (9082)"*/
/*Error management : dump errors messages : */
IF ( ERROR-STATUS:ERROR OR ERROR-STATUS:NUM-MESSAGES > 0 )
THEN DO:
OUTPUT STREAM dumpErr TO VALUE("Error_Iteration_" + STRING(ipiIterationRun) + ".txt").
DO iErrorNum = 1 TO ERROR-STATUS:NUM-MESSAGES :
PUT STREAM dumpErr UNFORMATTED "Progress ERROR " + STRING(iErrorNum) + " / " + STRING(ERROR-STATUS:NUM-MESSAGES) + " : '" + ERROR-STATUS:GET-MESSAGE(iErrorNum) + "'" SKIP.
END.
OUTPUT STREAM dumpErr CLOSE.
RETURN.
END.
oplIterationResult = VALID-OBJECT(oResponse). /*in case of error 9082, the oResponse object is not valid.*/
RETURN.
Last edited by a moderator: