1

私たちのアプリケーションは websphere でホストされており、私の webservice クライアント (jax-ws) はリモート サーバーへの webservice 呼び出しを行っています。この Web サービス呼び出しのタイムアウトを定義する必要があります。タイムアウトを設定する別の方法を試しましたが、うまくいきませんでした。ここに私が試したものがあります:

    Map<String, Object> requestContext = ((BindingProvider) binding).getRequestContext();
    requestContext.put("com.ibm.websphere.webservices.jaxws.asynctimeout", 15000); 

また

    Map<String, Object> requestContext = ((BindingProvider) binding).getRequestContext();
    requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 15000);
    requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT, 15000); 

それらのどれも機能しません

誰でもヒントを与えることができます.WebsphereでWebサービスクライアントのタイムアウトを設定する方法は?

どうも

4

2 に答える 2

0

WAS の Jax-WS は Axis 2 に依存しているため、標準の Axis 2 アプローチを使用してそれを行うことができると思います (Axis 2 のドキュメントから):

タイムアウト設定

トランスポート レベルには、ソケット タイムアウトと接続タイムアウトの 2 つのタイムアウト インスタンスが存在します。これらは、展開時または実行時に構成できます。展開時に構成する場合、ユーザーは次の行を axis2.xml に追加する必要があります。

ソケット タイムアウトの場合:

<parameter name="SO_TIMEOUT">some_integer_value</parameter>
For Connection timeout:

 <parameter name="CONNECTION_TIMEOUT">some_integer_value</parameter>

ランタイム構成の場合、クライアント スタブ内で次のように設定できます。

Options options = new Options();
options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(timeOutInMilliSeconds));
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(timeOutInMilliSeconds));

// or
options.setTimeOutInMilliSeconds(timeOutInMilliSeconds);
...

詳細情報が必要な場合は、http: //axis.apache.org/axis2/java/core/docs/http-transport.htmlを確認してください。

また:

http://wso2.org/library/209

http://singztechmusings.wordpress.com/2011/05/07/how-to-configure-timeout-duration-at-client-side-for-axis2-web-services/

ServiceClient を使用している場合は、このスレッドを確認してください: Axis2 ServiceClient options ignore timeout

うまくいったかどうか教えてください;)

于 2013-03-12T13:10:53.997 に答える
0

次のリンクに記載されている JVM プロパティを設定する必要があります -

https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/rwbs_jaxwstimeouts.html

bindingProvider.getRequestContext().put(com.ibm.wsspi.webservices.Constants.CONNECTION_TIMEOUT_PROPERTY, timeout);
bindingProvider.getRequestContext().put(com.ibm.wsspi.webservices.Constants.RESPONSE_TIMEOUT_PROPERTY, timeout);

タイムアウトを秒単位で文字列として設定します。

于 2015-12-28T21:36:43.487 に答える