I'm using JaxWsPortProxyFactoryBean in Spring to connect a SOAP webservice. The problem is that if in the moment of Spring start up the webservice is down (because of network problem). It will cause an Exception and stop the Spring initialization. I don't want this behavior, the application doesn't need to stop only because of a failure with a webservice connection.
Is there any better/correct way using Spring to deal with this problem ? Here is my current xml context.
<bean id="beanWebServiceSOAP" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean" lazy-init="true">
<property name="serviceInterface" value="com.company.bean.BeanWebServiceSoap" />
<property name="wsdlDocumentUrl" value="${bean.wsdldocumenturl}" />
<property name="namespaceUri" value="${bean.namespaceuri}" />
<property name="serviceName" value="BeanWebService" />
<property name="portName" value="BeanWebServiceSoap" />
</bean>
Thanks,
Maybe by setting the property 'lookupServiceOnStartup' to false:
<bean id="beanWebServiceSOAP" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean" lazy-init="true">
<property name="serviceInterface" value="com.company.bean.BeanWebServiceSoap" />
<property name="wsdlDocumentUrl" value="${bean.wsdldocumenturl}" />
<property name="namespaceUri" value="${bean.namespaceuri}" />
<property name="serviceName" value="BeanWebService" />
<property name="portName" value="BeanWebServiceSoap" />
<property name="lookupServiceOnStartup" value="false" />
</bean>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With