ページの先頭行へ戻る
Interstage Application Server V13.0.0 GlassFish 設計・構築・運用ガイド
FUJITSU Software

4.10.2 Webサービス運用環境のカスタマイズ

受信するリクエストメッセージのサイズ(添付ファイルとSOAPメッセージの合計)の上限指定

下記の方法で、Webサービスで受け付けるリクエストのサイズ(添付ファイルとSOAPメッセージの合計)を制限できます。

Webサービスを運用するGlassFish ServerクラスターのJavaVMオプションで、以下のシステムプロパティを指定してください。

プロパティ名

com.sun.xml.ws.transport.http.servlet.ServletConnectionImpl.maxRequestLength

指定値

処理を受け付ける最大のリクエストのサイズをバイト単位で指定してください。負の値、不正な値、またはint型の範囲を超えた値が指定された場合は、制限は無効(無制限)になります。

GlassFish Serverクラスター 「MyCluster」で運用されるWebサービスで処理するリクエスト上限サイズを1Mバイト(1048576バイト)に制限する場合の設定例

C:\Interstage\glassfish5\glassfish\bin\asadmin create-jvm-options --target MyCluster -Dcom.sun.xml.ws.transport.http.servlet.ServletConnectionImpl.maxRequestLength=1048576
Created 1 option(s)
Command create-jvm-options executed successfully.

/opt/FJSViaps/glassfish5/glassfish/bin/asadmin create-jvm-options --target MyCluster -Dcom.sun.xml.ws.transport.http.servlet.ServletConnectionImpl.maxRequestLength=1048576
Created 1 option(s)
Command create-jvm-options executed successfully.

Webサービス側で発生した例外のスタックトレースをクライアントへ返信する

原因の調査を迅速に行えるように、Webサービスまたはその運用環境で発生した予期せぬ例外のスタックトレースを、呼出し元のWebサービスクライアントに返信することができます。Webサービスを運用するGlassFish ServerクラスターのJavaVMオプションで、以下のシステムプロパティを指定してください。

プロパティ名

com.sun.xml.ws.fault.SOAPFaultBuilder.captureStackTrace

指定値

true

GlassFish Serverクラスター 「MyCluster」で運用されるWebサービスのリクエスト元へ、例外のスタックトレースを返信する設定例

C:\Interstage\glassfish5\glassfish\bin\asadmin create-jvm-options --target MyCluster -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.captureStackTrace=true
Created 1 option(s)
Command create-jvm-options executed successfully.

/opt/FJSViaps/glassfish5/glassfish/bin/asadmin create-jvm-options --target MyCluster -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.captureStackTrace=true
Created 1 option(s)
Command create-jvm-options executed successfully.

補足

上記のシステムプロパティcom.sun.xml.ws.fault.SOAPFaultBuilder.captureStackTraceと同様に、Webサービス側で発生した例外のスタックトレースをクライアントへ返信するために、以下の固有のシステムプロパティも利用できます。ただし、将来、固有のプロパティを維持しない可能性があるため、推奨しません。

プロパティ名

com.sun.xml.ws.fault.SOAPFaultBuilder.enableCaptureStackTrace

指定値

任意

GlassFish Serverクラスター 「MyCluster」で運用されるWebサービスのリクエスト元へ、例外のスタックトレースを返信する設定例

C:\Interstage\glassfish5\glassfish\bin\asadmin create-jvm-options --target MyCluster -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.enableCaptureStackTrace=true
Created 1 option(s)
Command create-jvm-options executed successfully.

/opt/FJSViaps/glassfish5/glassfish/bin/asadmin create-jvm-options --target MyCluster -Dcom.sun.xml.ws.fault.SOAPFaultBuilder.enableCaptureStackTrace=true
Created 1 option(s)
Command create-jvm-options executed successfully.

注意

Webサービスアプリケーションで明示的にthrows宣言されている非ランタイム例外は、本機能でもスタックトレースは返信されません。