1

I am trying to instruct DispatcherServlet to delegate to MessageDispatcher using WebServiceMessageReceiverHandlerAdapter instead of delegating to Controllers.

But the request payload is of JSON . Do we have default messageDispatcher for JSON similar to org.springframework.ws.soap.server.SoapMessageDispatcher for XML?

1 Answers1

0

The concern isn't clear. If we talk about SOAP, then it definitely should be Spring WS, but when the story is about JSON, then it exactly about Spring REST support in Spring MVC. Why would one try to overcomplicate with JSON SOAP when you simply can use REST service.

On the other hand there is nothing about Spring Integration in your question. Please, be specific when you select tags for the question here.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • Thanks for the reply Artem. But we are trying to use spring integration to handle Json payload without using spring MVC. Could be please suggest a workaround to implement it? – Sowmya Poovannan Jan 10 '18 at 15:49
  • Well, Spring Integration HTTP module is fully based on Spring MVC and in two words The HTTP Inbound Gateway is a full replacement of the `@RestController`, but in Messaging architecture. You still don't need SOAP for that purpose. The Spring Integration HTTP suggests you a `MappingJackson2HttpMessageConverter` for JSON requests... – Artem Bilan Jan 10 '18 at 15:57
  • Thanks Artem!. From dispatcherservlet , is there a possibility to route the request to message converter without a controller class? – Sowmya Poovannan Jan 16 '18 at 22:43
  • I'm not aware of that. You can have some generic controller method to accept `byte[]`, for example, and perform conversion manually. Spring Integration can help you there on the matter with its built-in transformers: https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/html/messaging-transformation-chapter.html#_common_transformers – Artem Bilan Jan 16 '18 at 22:48