Spring Integration HTTP messageDispatcher for JSON Payload - spring-integration

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?

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.

Related

How to download attachments from SF(salesforce) webservice using Spring Integration (WebService Inbound Adapter)

I have a situation where I have to pull the attachments from sfdc webservice and put it into some other ftp location. I need a suggestion, if anybody faced this situation please share approach.
please help to develop this interface
thanks in advance
Samba
You question isn't clear, so that would be better to share more info on the matter and maybe some code, config.
Anyway, Spring Integration WS module is fully based on the Spring WS projects and deals exactly with the WebServiceMessage abstraction.
Which you can cast to the MimeMessage in case of MTOM enabled on request/response.
And that one getAttachments() method.
In case of Inbound Gateway you can use extractPayload = false option and receive a full WebServiceMessage as a payload in downstream flow.
When you send request to the external service and receive response with an attachments, you should take a look into custom DefaultSoapHeaderMapper extension, where you can populate your attachments into headers in the extractUserDefinedHeaders overridden method.

Apigee Java Call Out Response

In a standalone java code, using Apache HTTPClient libs, implementing the NTLM Authentication with SharePoint Server and accessing its Web Service and receiving the huge XML content as response. Now this final output is in String format. Created the Java Call Out Policy and uploaded all the jars.
I need some help here,
How to pass the java's final output response to Apigee's response.
My requirement is: If I hit the Apigee API Proxy then I need to receive the Java's output(String) as Apigee's response.
Which policy is more appropriate to handle this response.
Appreciate your help! Thanks in Advance.
You can use the javacallout policy to author custom java code. Here is a related post in SO: Working With JAVA Callout in apigee?
You can try
message.setContent(string) to create the content, and
messageContext.setResponseMessage(Message)
in java code to directly write to output.

WSDL off ServiceStack REST API

I know this at least IMO is a stupid request. Because WSDL is old hat and sucks compared to just doing a RESTful API. But I have a corporate "mandate" where we want to do a REST API but then corporate wants a WSDL still. I know..it makes no sense and apparently we can't push back and say NO and tell them to just use our future REST API.
So can you generate a WSDL if I were to start creating a REST API with ServiceStack? Meaning I add uri attributes and such? So that I can "make them happy"?
I prefer not to use WCF, it's a nightmare with a ton of attributes and configuration to try and hack a RPC style web service to try and be RESTful. Obviously that doesn't work out too well.
SOAP along with REST is supported and you can have REST API along with soap wsdl. There are some recommendations posted in servicestack wiki that you can review and get started! You just need to implement the restful service and soap, json, xml etc are automatically supported.

does servicestack support SOAP webservices using MTOM?

I am trying to figure out how I can setup servicestack to recive mtom encoded soap messages, does any one know of an implementation?

Why do we need JAXB bean when configuring JSON for RESTful web services?

I'm reading the tutorial about configuring JSON for RESTful web services:
https://blogs.oracle.com/enterprisetechtips/entry/configuring_json_for_restful_web
JAXB defines how Java objects are converted from and to XML.
However I don't understand why we have to JAXB bean model when creating RESTful web services that return JSON response? After all it is JSON not XML, right?
However I don't understand why we have to JAXB bean model when
creating RESTful web services that return JSON response?
Short Answer
You don't have to use JAXB to create a RESTful service using a JAX-RS framework. JAX-RS provides the MessageBodyReader/MessageBodyWriter mechanism to plug-in whatever binding you want. JSON binding providers often include an implementation of these classes that you can use directly. Below is an example of how to do this with EclipseLink MOXy (I'm the tech lead):
http://blog.bdoughan.com/2012/05/moxy-as-your-jax-rs-json-provider.html
Advantage of Using JAXB
Applying a JAXB mapping provides an easy mechanism to provide one set of mappings to get both an XML and JSON representation of your data.

Resources