[Stackoverflow] [Progress OpenEdge ABL] OpenEdge Trouble fetching data from a SOAP API

Not open for further replies.


I'm using the built-in .NET classes to fetch data from a SOAP API. The following lines return the response message.

responseReader = NEW StreamReader (response:GetResponseStream(), encoding:default).
content = responseReader:ReadToEnd(). /*LONGCHAR*/

This works fine if there is only the SOAP XML message in the response. But in my case there is a possibility that the response contains additional files with formats like PDF, PNG and so on that are not encoded as Base64. This leads to an error as soon as the data is stored in the LONGCHAR variable.

I tried a few things. One was to change the encoding for the StreamReader object. This didn't cause an error, but it did corrupt the contents of the file, making it impossible to open. I'm not sure whether it's the correct way to handle use a LONGCHAR variable in this case, but I have not been able to find a way to get the data out of the StreamReader as a MEMPTR.

Continue reading...
Not open for further replies.