SOAP Envelope Size

1.6k Views Asked by At

I'll ask the question first, and then give some background: Does anyone know if the SOAP Envelope Size is calculated including the headers, or just the content outside of the tags?

Content-Length includes the header information, but I can't assume that Content-Length = Envelope Size. The SOAP specification doesn't seem to address the Envelope Size, and I'm starting to worry that it's a "Up to the implementer" kind of thing.

Any answers or leads would be great.

1

There are 1 best solutions below

0
On

If you are checking the if it exceeds maximum size you can do this way:

      if (maxMessageSize > 0) {
            FixedByteArrayOutputStream fbaos = new FixedByteArrayOutputStream(maxMessageSize);
            try {

            } catch (XMLStreamException e) {
                handleException("Error in checking the message size", e, synCtx);
            } catch (SynapseException syne) {
                synLog.traceOrDebug("Message size exceeds the upper bound for caching, request will not be cached");
                return;
            } finally {
                try {
                    fbaos.close();
                } catch (IOException e) {
                    handleException("Error occurred while closing the FixedByteArrayOutputStream ", e, synCtx);
                }
            }
        }

This is not the most efficient way to do it though. So I have asked it here