2012-06-01 31 views
0

我会先问这个问题,然后给出一些背景: 有谁知道SOAP Envelope Size是计算包括头还是只包含标签外的内容?SOAP信封大小

Content-Length包含标题信息,但我不能假定Content-Length = Envelope Size。 SOAP规范似乎没有解决信封大小问题,我开始担心这是一种“由实施者决定”的事情。

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

+0

'Content-Length'是响应的主体大小。如果您通过HTTP进行SOAP,那么SOAP XML是正文。您对SOAP信封尺寸有什么需求? – JohnDoDo

+0

我正在处理CWMP,并且正在测试9004错误,该错误要求超出最大SOAP信封大小,在这种情况下。 – Joshua

+0

然后用尽可能多的数据打包SOAP消息并发送出去。 – JohnDoDo

回答

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