Request_Content 在 agentcontext 中接收到大 XML 时为空

Request_Content in agentcontext empty when receiving a large XML

我在 IBM Domino 中有一个 java 代理,它处理由 HTTP POST 接收的 XML 内容。现在看来如果XML内容比aprox大。 1180 行,代理未处理 POST(XML) 内容。当我执行:

System.out.println(agentContext.getDocumentContext().getItemValueString("REQUEST_CONTENT"));

然后它returns为空。

是否有最大限制,如果你能给我指出一个解决方法,那将是很好的。

来自 this technote

If the POST data is less than 64 KB - Use REQUEST_CONTENT to access the POST data.

If the POST data is greater than 64 KB - Use REQUEST_CONTENT_000 to access the first 6 4KB chunk, REQUEST_CONTENT_001 to access the second 64 KB chunk, REQUEST_CONTENT_002 to access the third 64 KB chunk, and so on.

A developer can use the NotesDocument.HasItem("REQUEST_CONTENT") call to test for the presence of the REQUEST_CONTENT field. If it exists, then there was less than 64 KB of POST data.

我用的是这样的:

private String getRequestContent(Document document) throws Exception {
    String returnObject = "";

    try {
        if (document.hasItem("Request_Content")) {
            returnObject = document.getItemValueString("Request_Content");
        }
        else {
            if (document.hasItem("Request_Content_000")) {
                for (int i = 0; i < 100; i++) {
                    String fieldName = "Request_Content_" + String.format("%03d", i);
                    returnObject += document.getItemValueString(fieldName);
                }
            }
            else {
                throw new Exception("Request_Content fields not found");
            }
        }
    }
    catch (Exception e) {
        throw new Exception("could not retrieve the Content from the Request", e);
    }

    return returnObject;

}