SOAP信封大小

时间:2012-06-01 16:01:34

标签: soap envelope

我先问问题,然后给出一些背景知识: 是否有人知道是否计算了包含标题的SOAP信封大小,还是只包含标记之外的内容?

Content-Length包含标题信息,但我不能假设Content-Length = Envelope Size。 SOAP规范似乎没有解决Envelope Size,我开始担心它是一个“直到实现者”的事情。

任何答案或线索都会很棒。

1 个答案:

答案 0 :(得分:0)

如果您正在检查它是否超过最大尺寸,您可以这样做:

      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);
                }
            }
        }

这不是最有效的方法。所以我问了here

相关问题