私はいくつかのSOAP APIを呼び出すためにスプリング・ウェブ・サービス・フレームワークを使用しています。私はプロトタイプのスコープを使用していますタイムアウト・スプリング・ウェブ・サービスの読取り
<bean name="wsTemplate" class="org.springframework.ws.client.core.WebServiceTemplate" scope="prototype" >
<constructor-arg ref="messageFactory" />
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="unmarshaller"/>
</bean>
<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="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" >
<property name="contextPaths">
<list>
some configured classes here
</list>
</property>
</bean>
<bean id="unmarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" >
<property name="contextPaths">
<list>
some configured classes here
</list>
</property>
</bean>
注: 私の構成はこのようなものです。それが問題を引き起こす可能性があるかどうかはわかりません。
私はこのようなWebServiceTemplateを使用する私のJavaコードで:私はこのようなWebサービスを呼び出す
@PostConstruct
private void init() {
try {
String uri = "https://web/file.svc?wsdl"
webServiceTemplate.setDefaultUri(uri);
} catch (Exception exception) {
logger.error("Error creating URL for the wsdl location.", exception);
}
}
:
Response response = (Response) webServiceTemplate.marshalSendAndReceive(request, new SoapActionCallback(SOAP_ACTION_URL));
私は何を確認していない例外を、次の読み取り時間を取得していますそれは、私がそれを読んだのは、応答が大きすぎるためですが、実際にはそうではありません。それは100Kを超えていません
org.springframework.ws.client.WebServiceIOException:I/Oエラー:読み取りタイムアウト。入れ子になった例外はjava.net.SocketTimeoutExceptionです:読み取りタイムアウト 15:27:49,028 INFO [stdout](デフォルトのタスク-22)at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:561)〜 [spring-ws-core-2.2.4.RELEASE.jar:2.2.4.RELEASE] 15:27:49,028 INFO [stdout](デフォルトタスク-22)(org.springframework.ws.client.core.WebServiceTemplate) marshalSendAndReceive(WebServiceTemplate.java:390)〜[spring-ws-core-2.2.4.RELEASE.jar:2.2.4.RELEASE] 15:27:49,028情報[stdout](デフォルトタスク-22)at org.springframework .ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383)〜[spring-ws-core-2.2.4.RELEASE.jar:2.2.4.RELEASE]
何が問題になりますか?私は無知です
http://stackoverflow.com/questions/6733744/how-to-set-timeout-in-spring-webservicetemplate – VirtualTroll