0

現在、非常に大きな応答を返す SOAP Web サービスを呼び出しています。

Spring-WS (WebServiceTemplate を使用)、JAX-WS クライアントを使用して Web サービスを呼び出し、アプリケーションは Jboss EAP 6.0 で実行されます。

現在、SaajSoapMessageFactory も使用しています。読み取りパフォーマンスを向上させるには、SaajSoapMessageFactory ( http://docs.spring.io/spring-ws/site/reference/html/common.html )ではなく AxiomSoapMessageFactory を使用する必要があることをフォーラムから読みました。

次の変更を行いました。

交換済み

<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"> 
        <property name="soapVersion">
            <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_11" />
        </property>
    </bean>

 <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
        <property name="payloadCaching" value="true"/>
    </bean>

この変更は期待どおりに機能しました。ただし、上記のリンクは、次のように設定することを提案しています。

 <property name="payloadCaching" value="false"/>

このオプションを設定した後、Web サービスが呼び出されると、次の例外が発生します。

org.springframework.ws.soap.axiom.AxiomSoapBodyException: Could not access envelope: null; nested exception is org.apache.axiom.om.NodeUnavailableException: org.springframework.ws.soap.axiom.AxiomSoapBodyException: Could not access envelope: null; nested exception is org.apache.axiom.om.NodeUnavailableException
    at org.springframework.ws.soap.axiom.AxiomSoapEnvelope.getBody(AxiomSoapEnvelope.java:97) [:2.2.0.RELEASE]
    at org.springframework.ws.soap.AbstractSoapMessage.getSoapBody(AbstractSoapMessage.java:38) [:2.2.0.RELEASE]
    at org.springframework.ws.soap.AbstractSoapMessage.getPayloadSource(AbstractSoapMessage.java:50) [:2.2.0.RELEASE]
    at org.springframework.ws.support.MarshallingUtils.unmarshal(MarshallingUtils.java:55) [:2.2.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate$3.extractData(WebServiceTemplate.java:413) [:2.2.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:616) [:2.2.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555) [:2.2.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390) [:2.2.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383) [:2.2.0.RELEASE]
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:373) [:2.2.0.RELEASE]

このエラーの理由についてのアイデアはありますか? 他のオプションを変更し忘れたのでしょうか、それとも私が使用したライブラリ ファイルの非互換性でしょうか。

別の質問:


og4j.logger.org.springframework.ws.client.MessageTracing に関連する log4j エントリをコメントアウトした後、Web サービスを正常に利用できました。また、パフォーマンス テストを実行したところ、50 人のユーザーが同時に Web サービスにアクセスしている (Web サービスを呼び出す画面を介して間接的に) テストでは、全体的な応答時間 (ボタンがクリックされた瞬間から、 Web サービスが画面に再表示されます) 約 27 秒から 22 秒に短縮されました。これは、SaajSoapMessageFactory よりも 5 秒短縮されています。ただし、100 ユーザー テストを実行したところ、応答時間が 2 秒増加し、この場合は SaajSoapMessageFactory の方が優れているように見えます。AxiomSoapMessageFactory がストリーミングを使用し、ツリーの構築を回避しているにもかかわらず、このパフォーマンスの違いの理由を誰かが説明できますか??

4

1 に答える 1

1

payloadCaching=falseペイロードのオブジェクト モデル ツリーを構築しないように Axiom に指示します。これによりパフォーマンスが向上しますが、ペイロードに一度しかアクセスできないことも意味します。Axiom の古いバージョンでは、ペイロードに 2 回アクセスしようとすると、ややあいまいなOMException. 最新バージョンでは、 JavadocNodeUnavailableExceptionに記載されている をトリガーします。コメントで指摘したように、あなたの場合、ペイロードはトレース ロギングによって消費されます。

于 2014-07-22T22:08:44.770 に答える