please refer to the above answers

Regards

On Wed, Nov 15, 2017 at 2:35 PM, Dushantha Batuwita <dushan...@wso2.com>
wrote:

> Hi Buddhimala
> Accessing the JSON payload parameters and retrieving those within the
> proxy service can be achieved with the <args> element of the Payload
> factory mediator according to your scenario.
> Setting already retrieved parameters to the predefined soap structure is
> accomplished within the <format> element.
>
> suppose that we need to access the following JSON structure
>
> {
>     "orderLine": {
>
>         "ordername": "Cooking Item",
>         "orderid": "123456",
>         "product": {
>
>             "productname": "coconutoil",
>             "productgrade": "drade1",
>             "productcolour": "white"
>
>         }
>     }
> }
>
>
> and retrieve the values in order to set to the soap structure given bellow
> within the payload factory is as follows refer to document[1] for further
> details
> <payloadFactory media-type="xml">
>         <format>
>             <soapenv:Envelope
>                 xmlns:ser="http://service.sample.oasis.com";
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="
> http://dto.service.sample.oasis.com/xsd";>
>                 <soapenv:Header/>
>                  <soapenv:Body>
>                     <ser:addOrderLineRecord>
>                         <ser:orderLine>
>                             <xsd:product>
>                                 <xsd:productname>$1</xsd:ordername>
>                                 <xsd:productgrade>$2</xsd:orderid>
>                                 <xsd:productcolour>$3</xsd:productcolour>
>                             </xsd:product>
>                             <xsd:ordername>$4</xsd:ordername>
>                             <xsd:orderid>$5</xsd:orderid>
>
>                         </ser:orderLine>
>                     </ser:addOrderLineRecord>
>                 </soapenv:Body>
>             </soapenv:Envelope>
> </format>
> <args>
>             <arg *evaluator="json"*
> *expression="$.orderLine.product.productname"*/>
>             <arg evaluator="json" expression="$.orderLine.
> product.productgrade"/>
>             <arg evaluator="json" expression="$.orderLine.
> product.productcolour"/>
>             <arg evaluator="json" expression="$.orderLine.ordername"/>
>             <arg evaluator="json" expression="$.orderLine.orderid"/>
> </args>
> </payloadFactory>
>
> NOTE: when you set the $n parameter to be couches to follow the order in
> which the args are defined. i.e. the first line of the arg refer to $1..
> and etc
>
> Regards
>
> On Wed, Nov 15, 2017 at 2:32 PM, Buddhimala Ranasinghe <
> buddhim...@wso2.com> wrote:
>
>> Hi All,
>>
>> I need to pass a json payload from an API to ESB proxy service. In ESB,
>> I'm using parameters in the passed JSON payload inside payloadFactory
>> mediator in my ESB which will be sent towards a secured SOAP BE. Can you
>> please guide me on this? I need to know how could those parameters can be
>> addressed inside my proxy service.
>>
>> Regards,
>> Buddhimala
>>
>> --
>>
>>
>> *Buddhimala Ranasinghe*
>> Software Engineer-Support Team | WSO2
>> Emil: buddhim...@wso2.com
>> Mobile:+94771563138 <+94%2077%20156%203138>
>> Web:http://wso2.com
>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Dushantha Nayanajith Chandima Batuwita*
> Software Engineer Support | WSO2
> dushan...@wso2.com
> mobile : 0094777453010
>



-- 
*Dushantha Nayanajith Chandima Batuwita*
Software Engineer Support | WSO2
dushan...@wso2.com
mobile : 0094777453010
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to