Domino Web 服务提供商限制

Domino web service provider limitation

我正在实现一个 domino web 服务提供商,其目的是从 base64 格式流式传输,在使用 web 服务的客户端中它是一个附件文件,将其转换回文件。在java开发的web服务提供者中,我使用Streamclass和Mimeclasses来转换流和文件。 Web 服务提供商适用于最大 5 MB 的文件,对于更大的文件,将显示 technote 错误。有人遇到过这个问题吗?有什么解决办法吗?

这是网络服务提供商的代码

public class criaAnexo {
private Vector itemsToRecycle;
public void attachDocument( byte[] is) {

    // creating the output stream used to create the MIME attachments
    try
    {

        itemsToRecycle = new Vector(); 
        Session session = NotesFactory.createSession();
        Database db = session.getDatabase("Serverx", "base.nsf");
        if (!db.isOpen())
            System.out.println("names2.nsf does not exist on snapper");
        else
        {
            Stream outStream = session.createStream();
            outStream.write(is);


            session.setConvertMIME(false);

            // create the MIME body
            Document doc = db.createDocument();
            doc.replaceItemValue("Form", "formAttachment");
            MIMEEntity body = doc.createMIMEEntity();


            // create a child for each attachment<br/>
            MIMEEntity child = body.createChildEntity();

            // find the fileSuffix<br/>
            //String fileSuffix = files[i].substring(files[i].lastIndexOf(".")+1);
            String fileSuffix = "pdf";


            // set the child to the outstream using a mapped MIME type<br/>
            // MIME type mapping see: http://www.w3schools.com/media/media_mimeref.asp

            //child.setContentFromBytes(outStream, mapMIMEType(fileSuffix), MIMEEntity.ENC_IDENTITY_BINARY);

            child.setContentFromBytes(outStream, "application/pdf", MIMEEntity.ENC_IDENTITY_BINARY);


            // set name for file attachment<br/>
            MIMEHeader header = child.createHeader("Content-Disposition");
            header.setHeaderVal("attachment; filename=\"teste.pdf\"");

            // set unique id for file attachment to be able to refer to it<br/>
            header = child.createHeader("Content-ID");
            header.setHeaderVal("teste.pdf");

            //outStream.truncate();
            //outStream.close();
            outStream.close();
            Runtime rt = Runtime.getRuntime(); 
            long total_mem = rt.totalMemory(); 
            long free_mem = rt.freeMemory(); 
            long used_mem = total_mem - free_mem; 
            System.out.println("Total de Memória:"+total_mem); 
            System.out.println("Total de Memória livre:"+free_mem);
            System.out.println("Total de memoria usada pelo agente: " + used_mem/1048576);  


            doc.save( true, true );
            itemsToRecycle.add(doc);
            session.recycle(itemsToRecycle); //recycle all items added to vector 
            session.recycle();

        }



    }
    catch(Exception e)
    {
    }
}

}

由于 base64 编码和其他开销,大于 5 MB 的文件可能会超过您为 请求内容的最大大小 和 [=12= 配置的 10 MB 限制]服务器的最大 POST 数据 设置。尝试增加它们。

事实上,限制出现在使用我在 domino 本身中实现的 Web 服务的客户端中。问题描述中引用的技术说明暗示问题出在提供商方面,但实际上并非如此。当我在 dot net 上实现 Web 服务客户端时,文件流式传输没有问题。