Announcement Announcement Module
No announcement yet.
How to handle spring webservice client Connection exceptions elegantly Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to handle spring webservice client Connection exceptions elegantly


    probably a dumb question but were currently developing a web application which links to many web services. Were using Spring 2.0 Jax RPC web service clients as described in the user guide.

    THe problem is, during our development phase the dependent development web services are always being stopped/started and if they are not available the web service client throws an exception (org.springframework.beans.factory.BeanCreationExc eption: Error creating bean with name.............. javax.xml.rpc.ServiceException: Error processing WSDL document: Connection refused: connect) which then means the dependency injector cannot creat the client class which stops all dependent classes and basically stops the web application.

    For instance, we use an address search web service but what we want is if the address search web service is unavailable, that the application carries on processing but returns a message to the client stating the service is down.

    I can see only one way to do this and that is to implement some kind of web service client service locator (plumbing code which spring has replaced) which checks for exceptions from the web service and returns a nice user message. (This service locator will pull the clients from the spring bean factory)

    Has anyone come up with a different solution?