Using MessageDispatcherServlet vs wiring up Spring-WS in a DispatcherServlet

As I was going through the spring reference for Webservices, I got to know that there are two ways to implement jax-ws webservices in spring.

One is by using MessageDispatcherContext, which I found is the easiest way to go about.

And the other way is to wire Spring-ws in a DispatcherServlet using some adapters like WebServiceMessageReceiverHandlerAdapter and SimpleControllerHandlerAdapter etc.

I couldn't understand the need of this second approach as at first, it looks a bit complex to me. Please help me understand why I should use this second approach and given a scenario which approach is best suited.

Thank you.

Answers


The answer to this question lies in the Spring Webservices documentation itself :

The message dispatcher operates on a message context, and not transport-specific input stream and output stream.

As a result, transport specific requests need to read into a MessageContext.

For HTTP, this is done with a WebServiceMessageReceiverHandlerAdapter, which is a Spring Web HandlerInterceptor`, so that the MessageDispatcher can be wired in a standard DispatcherServlet.

http://docs.spring.io/spring-ws/site/reference/html/server.html

You should use WebServiceMessageReceiverHandlerAdapter because in most cases the Transport is HTTP/S . However if your application serves as Service Bus like Mule - MessageDispatcher is more suited


Need Your Help

working with php and python together

php python mysql excel

currently i am working on a project which is related to automation.

How to remove content of <li>tags from HTML

python beautifulsoup

I am trying to remove the contents of &lt;li&gt; tags