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=“The "xml:" Namespace” xmlns:xsd=“XML Schema” 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