Hi Maz,

I tried with the following proxy service and I got the correct response.

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse";
       name="payloadJsonTest"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <payloadFactory media-type="json">
            <format>{ "ip_address": "$1"}</format>
            <args>
               <arg evaluator="json" expression="$.origin"/>
            </args>
         </payloadFactory>
         <respond/>
      </inSequence>
   </target>
   <description/>
</proxy>

Thanks,
Tanya



On Tue, Jan 6, 2015 at 3:04 PM, Maz Lakadia <[email protected]> wrote:

> Hi, I am mediating a message using Payload Factory Mediator. The
> unmediated message is:
>
> {
>  "origin": "202.68.75.242"
> }
>
> My mediated payload is meant to be:
>
> {
>  "ip_address": "202.68.75.242"
> }
>
> Instead it gives me back:
>
> {  "jsonObject" :
>     {
>      "ip_address": "202.68.75.242"
>     }
> }
>
> How can I get rid of the "jsonObject" wrapper?
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Tanya Madurapperuma

Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94718184439
Blog : http://tanyamadurapperuma.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to