Forum Discussion

fkammermann's avatar
fkammermann
New Contributor
13 years ago

responseContent.size() vs rawResponseData.length

I try to figure out the size of the the soap response.

Like everytime soapUI provides me the the required tools.
But this time it provides me 2 tools and I don't know what's the meaning of the answers.

When I use
messageExchange.responseContent.size()

The answer is: 1466492

When I use
messageExchange.rawResponseData.length

The answer is: 794207

I implemented also a SOAPHandler serverside, where I use the following code:

SOAPMessage message = messageContext.getMessage();
CountingOutputStream countingOutputStream = new CountingOutputStream(new NullOutputStream());

try {
message.writeTo(countingOutputStream);
} catch (Exception e) {
throw new RuntimeException(e.toString());
}

long bytes = countingOutputStream.getByteCount();
String size = FileUtils.byteCountToDisplaySize(bytes);
LOG.info("the response size is: " + size);

The result of this is: 793969

So what's the difference between
messageExchange.responseContent.size()
and
messageExchange.rawResponseData.length
  • Ok got it.

    The difference comes from this preference:
    File --> Preferences --> WSDL Settings --> Pretty Print


    When I uncheck the Pretty Print, then
    messageExchange.responseContent.size()


    returns me: 793553

    I accept this as equal to 794207