PDA

View Full Version : Dealing with unavailable web services



jwray
Jul 22nd, 2005, 02:19 PM
Hi,

I'm using JaxRpcPortProxyFactoryBean to provide access to a web service I need for my application and, when the service is up (I have no control over it), all is fine.

My question is how to deal with the situation when the service is down at application startup. Currently, this throws a BeanCreationException when the application context is read. Is there anything in Spring to deal with this situation? Basically, not just fail, but continue to construct the rest of the beans/services. Then, when the specific service is needed, check to see if it has actually been constructed correctly, maybe try again, etc.

thanks for any pointers,

Jonny

isusanin
Jul 27th, 2005, 04:34 PM
I guess you could create a separate ApplicationContext/BeanFactory for JaxRpcPortProxyFactoryBean and surround the loading of this isolated application context with try catch.

dejanp
Jul 28th, 2005, 08:31 AM
Hi,

I'm using JaxRpcPortProxyFactoryBean to provide access to a web service I need for my application and, when the service is up (I have no control over it), all is fine.

My question is how to deal with the situation when the service is down at application startup. Currently, this throws a BeanCreationException when the application context is read. Is there anything in Spring to deal with this situation? Basically, not just fail, but continue to construct the rest of the beans/services. Then, when the specific service is needed, check to see if it has actually been constructed correctly, maybe try again, etc.

thanks for any pointers,

Jonny

I'm not sure, but I don't think it should fail at startup at all, unless you try to get the wsdl from the server.