1 Reply Latest reply on Jun 15, 2015 10:23 AM by Ricardo Wangnet

    SwitchYard - RESTEasy [JSON] Composite Service to SOAP Composite Reference Transformations

    emin1234 Newbie

      Hi,

       

      I am trying to build an application where i want to expose a REST web service where the REST service produces some JSON. The content/data of the JSON response (of the rest endpoint) comes from a Composite Reference which has SOAP Binding. So this comes down to  following:

       

      1. Component (Camel Implementation)

      2. Service promotion of the Component (Camel Implementation) which results in a Composite Service

      3. Assign a REST(Easy) Binding to the Composite Service.

      4. Create a Component Reference  on the Component

      5. Promote the Component reference with the WSDL

       

      This results in a composite like image01 (see attachment).

       

      Now i managed to call de rest endpoint and the receive the parameter of the rest endpoint in my component (camel Route). Now in my WSDL i have an operation called "GetDataByPhoneNumber" which takes an phone number as the parameter. This operation returns a "GetDataByPhoneNumberResponse" type which has one element in it where the data of the element is wrapped to an CDATA block. My problems is as following : How do ik create an appropriate request to the SOAP Service where the parameter of the request is filled with the parameter i received of the REST endpoint.

       

      To give additional context:

      What i want to do is convert the response of the SOAP request to a JSON format... (this JSON format is domain specific, so eventually we want 1 JSON response in the rest endpoint where the data descents of different SOAP endpoints).

       

      My feeling is that i need to do something with the transformers. But when i select "Create Required Transformer" i only get the option the convert the response to, for example a pojo, now what i want is to convert the data on my body of the exchange to a request type where the type is specified in the WSDL, so i can make a call to the (SOAP) Composite Reference from within my (camel) component.

      Can someone explain what i need to do to make this work

      If needed i can post the code/project to.

       

      Awaiting a response....

       

      With kind regards.