on 09-30-2014 4:52 PM
Hi Experts,
I am getting incoming message content type as application/json, I want to change the content type of the output payload from application/json to application/xml in java mapping please suggest me how can i achieve this in java mapping.
Regards,
Rachana.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public void transform(TransformationInput in , TransformationOutput out) throws StreamTransformationException {
try {
[...]
out.getOutputHeader().setContentType("application/xml"); //for example
} catch (Exception e) {
throw new StreamTransformationException("Error");
}
}
(Just in case the linked Blog gets send to nirvana due to the next inevitable change of the community software by SAP. Cheers)
Hi Rachana,
As far as i know there is no standard bean functionality to transform json, You can try with an own module bean or a java mapping and to translate from json to XML. You can find some examples on internet:
Heshan's Blog: Java library to convert XML to JSON
Converting JSON to XML in Java - Stack Overflow (you would need to import the library)
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.