0

I am new to WSO2 and don't know how to use the declaritive programming widgets to create the REST contract. My use case; I have a backend SOAP 1.2 Web Service that I want to wrap with a REST API in WSO2. I don't know what media to use to define the JSON data contract so it is avalable in the sequence flow. I want to be able to visually map from the JSON payload to the SOAP payload. I really wanted to have two declaritive objects that I drag onto the sequence pallet so I can map from the JSON to the SOAP XML.

Thanks much

Community
  • 1
  • 1

1 Answers1

1

You can use a XSLT mediator (Sample 440) or Script mediator (Sample 441) to do the JSON to SOAP mapping. But you will have to type in the XSLT template or the script content manually after adding the mediators through Developer Studio. I don't think you can visually map elements from JSON payload to SOAP.

Go through above samples or this webinar to learn how do the transformations.

Nufail
  • 1,588
  • 1
  • 17
  • 31
  • Thanks the webinar link was a little more helpful. In looking at webinar script code it looks like "mc" is the object that reference the data that is coming through the sequence, is this true? I was kinda hoping that there was a mediator that you could apply a link to a schema that was defined in the Gov registry and after you applied it, it mapped to the message payload. – user3033829 Nov 26 '13 at 19:42
  • `mc` is the MessageContext object. It contains all details of the message. You can use the XSLT mediator method, where you define XSLT file to do the transformation and add it to Gov registry or as a local entry in ESB. Then just link to that file from XSLT mediator in the sequence and it will do the transformations. – Nufail Nov 27 '13 at 05:52