[Stackoverflow] [Progress OpenEdge ABL] how to read xml file and export a item in progress 4gl

Status
Not open for further replies.
N

Nikolai Ivanov

Guest
hello friends I hvae and problem beacuse i do this for read an xml file in progress and i need only 3 items of that xml but this can not read ir.

the code in progress is:


DEFINE VARIABLE hDoc AS HANDLE NO-UNDO.
DEFINE VARIABLE hRoot AS HANDLE NO-UNDO.
DEFINE VARIABLE hTable AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.
DEFINE VARIABLE hText AS HANDLE NO-UNDO.
DEFINE VARIABLE hBuf AS HANDLE NO-UNDO.
DEFINE VARIABLE hDBFld AS HANDLE NO-UNDO.
DEFINE VARIABLE ix AS INTEGER NO-UNDO.
DEFINE VARIABLE jx AS INTEGER NO-UNDO.
DEFINE VARIABLE returnCode AS DECIMAL NO-UNDO.
DEFINE VARIABLE returnMessage AS CHARACTER NO-UNDO.
DEFINE VARIABLE bravoId AS CHAR NO-UNDO.

CREATE X-DOCUMENT hDoc.
CREATE X-NODEREF hRoot.
CREATE X-NODEREF hTable.
CREATE X-NODEREF hField.
CREATE X-NODEREF hText.


/* Read in the file created in i-outcus.p */
hDoc:LOAD("file", "C:\user53.xml", TRUE).
hDoc:GET-DOCUMENT-ELEMENT(hRoot).

REPEAT ix = 1 TO hRoot:NUM-CHILDREN:
hRoot:GET-CHILD(hTable, ix).

/* Get the fields given as attributes */

string(returnCode) = hTable:GET-NODE("returnCode").
returnMessage = hTable:GET-NODE("returnMessage").
bravoId = hTable:GET-NODE("Id").
REPEAT jx = 1 TO hTable:NUM-CHILDREN:
hTable:GET-CHILD(hField, jx).
hField:GET-CHILD(hText, 1).
hDBFld:BUFFER-VALUE = hTEXT:NODE-VALUE.
END.
END.

DELETE OBJECT hDoc.
DELETE OBJECT hRoot.
DELETE OBJECT hTable.
DELETE OBJECT hField.
DELETE OBJECT hText.

FOR EACH v:
DISPLAY ' ReturnCode: ' + STRING(returnCode) + ' - ReturnMessage: ' + returnMessage + ' id: ' + id.
END.
and the xml file is this:


<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:ImportProfilesResponse xmlns:ns1="http://host.bs.com/common/webservice/ProfileManagement/">
<returnCode>-996</returnCode>
<returnMessage>Invalid SOAP Request Object - 112(FISCAL_CODE);</returnMessage>
<id>0000</id>
</ns1:ImportProfilesResponse>
</soapenv:Body>
</soapenv:Envelope>

i need to solve it.

thank for our help.

Continue reading...
 
Status
Not open for further replies.
Top