SOAP Message return as Buffered Input Stream?

Hello,

I am getting below response from one of the WS in BufferedInputStream as follows,

<?xml version="1.0" encoding="utf-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope” xmlns:xml=“http://www.w3.org/XML/1998/namespace” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<SOAP-ENV:Header xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope” xmlns:SOAP-ENC=“http://www.w3.org/2003/05/soap-encoding”></SOAP-ENV:Header>SOAP-ENV:Body
<ser-root:getcountriesResponse xmlns:ser-root=“http://gxs-wm/makkahwsmtom/provider/getCountriesProvider”>java.io.BufferedInputStream@1e668b7</ser-root:getcountriesResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Please anyone direct me how I can convert it string? I have used below java code but I get the error that getCountryRS is string and not bytes.

try{
IDataCursor pipelineCursor = pipeline.getCursor();
ByteArrayInputStream bais = (ByteArrayInputStream) IDataUtil.get( pipelineCursor, “getCountryRS” );
//BufferedReader reader = (BufferedReader) IDataUtil.getObject( pipelineCursor, “getCountryRS” );
pipelineCursor.destroy();

int length = bais.available();
byte [] buff = new byte[length];
bais.read(buff);
String theString = new String(buff);
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, “theString”, theString );
pipelineCursor_1.destroy();
}
catch(IOException e)
{
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, “theString”, e.toString() );
pipelineCursor_1.destroy();
}

Any input please?

Regards,
Faisal

The module that is returning the response needs to read the input stream completely and return a string. What you’re seeing is not a BufferedInputStream at all but rather the string representation of the BufferedInputStream object address as it existed in the called service. There is nothing you can do with that field of the response–the called service needs to be corrected.

Thank you for your reply.

Regards,
Faisal