2017-06-29 12 views
0

私は、Webサービスを使用するクライアントで添付ファイルであるbase64形式からストリーミングすることを目的としたdomino Webサービスプロバイダを実装しています。 Javaで開発されたWebサービスプロバイダでは、StreamクラスとMimeクラスを使用してストリームとファイルを変換します。 Webサービスプロバイダは、最大5 MBのファイルに対してうまく機能します。大きいファイルの場合は、technoteというエラーが表示されます。誰にもこの問題はまだありましたか?その周りには道がありますか?ここDomino Webサービスプロバイダの制限

起因base64エンコーディング及び他のオーバーヘッドのウェブサービスプロバイダ

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

}

+0

ドミノサーバーのサーバー文書の「要求内容の最大サイズ」設定と、適切なWebサイト構成文書の「最大POSTデータ」設定を確認しましたか?説明については、ここを参照してください。https://www.ibm.com/support/knowledgecenter/en/SSKTMJ_8.5.3/com.ibm.help.domino.admin85.doc/H_RESTRICTING_THE_AMOUNT_OF_DATA_USERS_CAN_SEND_TO_THE_SERVER_STEPS.html –

+0

両方のパラメーターが10MBに設定されています。 –

答えて

0

実際、この制限は、ドミノ自体で実装したWebサービスを使用するクライアントで発生します。問題の説明で引用された技術者は、問題はプロバイダの側にあることを意味しますが、実際には問題ではありません。ドットネット上にWebサービスクライアントを実装すると、ファイルは問題なくストリーミングされました。

+0

Webサービスをlotusscriptで消費するようにクライアントを実装した場合にのみ、補完が問題になります。 Javaでは、問題は発生しません。 –

0

ためのコードである5 MBを超えるファイルは、のために構成された10 MBの限界を超えることができます要求内容の最大サイズおよびご使用のサーバーの最大POSTデータの設定。それらを増やしてみてください。

+0

両方のパラメータを50 MBに増やしましたが、エラーは解決しません。 –

+0

サーバーのhttpタスクを再起動しましたか?それが必要かどうかは分かりませんが、そうかもしれません。 –

+0

はい、Domino全体を再起動しました。 –

関連する問題