Get the XML answer of a web service

cferriol

Member
I finished the server side of my application. I put an HTTP Post to my server an I get back and XML.
Following the example on Progress Knowledge Base answer ID: P125506, I make the client application. The example is pretty good but they use a CHAR variable to store de server response. The problem is if the response is larger than 32 KB the program send an error.
Is it possible to get the response directly in an XML object?
 

cferriol

Member
I have Progress 9. What I did is store the data in a MEMPTR var

DEFINE VARIABLE mResponse AS MEMPTR.
DEFINE VARIABLE mRespuesta AS MEMPTR.
DEFINE VARIABLE mTMP AS MEMPTR.
...
SET-SIZE(mRespuesta) = 0.
DO WHILE lSuccess AND ERROR-STATUS:GET-MESSAGE(1) EQ '' :
SET-SIZE(mResponse) = 1.
SET-BYTE-ORDER(mResponse) = BIG-ENDIAN.
SELF:READ(mResponse,1,1,1).
iLargo = GET-SIZE(mRespuesta).
SET-SIZE(mTMP) = 0.
IF iLargo > 0 THEN DO:
SET-SIZE(mTMP) = iLargo.
PUT-BYTES(mTMP,1) = mRespuesta.
END.
SET-SIZE(mRespuesta) = 0.
SET-SIZE(mRespuesta) = iLargo + 1.
PUT-BYTES(mRespuesta,1) = mTMP.
PUT-BYTES(mRespuesta,iLargo + 1) = mResponse.
lSuccess = SELF:CONNECTED().
END.

After this I have the hole string in mRespuesta. It has the XML and the HTTP header but I need to extract the XML

HTTP/1.1 200 OK
Date: Mon, 09 Mar 2009 19:32:52 GMT
Server: Apache/2.0.46 (Red Hat)
Connection: close
Content-Type: text/xml

<?xml version="1.0" ?>
<Datos_Orden> ... </Datos_Orden>
 
Top