Hi Malaka,

I tried with this and still having a problem.

var
a=<jsonObject><?xml-multiple?><tags<jsonElement>TestTag</jsonElement></tags></jsonObject>;

Output:

"jsonObject":{"tags":"TestTag"}

Regards,
Janaka


On Thu, Jul 24, 2014 at 5:50 PM, Malaka Silva [via WSO2 Oxygen Tank] <
[email protected]> wrote:

> Hi,
>
> Try following
>
> var tagElement=<jsonObject><?xml-multiple?><tags><jsonElement>
> TestTag</jsonElement></tags></jsonObject>;
>
>
>
> On Wed, Jul 23, 2014 at 1:52 PM, Jay <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=100231&i=0>> wrote:
>
>> Hi Malaka,
>>
>> I have tried with your solution but it didn't work.
>>
>> following is my javascript code:
>>
>> var
>>
>> tagElement=<tags><?xml-multiple?><jsonElement>TestTag</jsonElement></tags>;
>>
>> payloadXML.tags=tagElement;
>>
>> This will create JSON payload as :
>>
>> {"tags":"TestTag"}
>>
>> But the requirement is:
>>  {"tags":["TestTag"]}
>>
>> I have enabled following message builder/formatter as well,
>>
>> <messageFormatter contentType="application/json"
>>
>> class="org.apache.synapse.commons.json.JsonFormatter"/>
>> <messageBuilder contentType="application/json"
>>
>> class="org.apache.synapse.commons.json.JsonBuilder"/>
>>
>> Regards,
>> Janaka
>>
>>
>>
>> --
>> View this message in context:
>> http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-Problems-sending-numeric-keys-in-JSON-Payloads-tp99789p100001.html
>> Sent from the WSO2 Development mailing list archive at Nabble.com.
>> _______________________________________________
>> Dev mailing list
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=100231&i=1>
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Tech Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>
> _______________________________________________
> Dev mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=100231&i=2>
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-Problems-sending-numeric-keys-in-JSON-Payloads-tp99789p100231.html
>  To unsubscribe from [ESB] Problems sending numeric keys in JSON Payloads, 
> click
> here
> <http://wso2-oxygen-tank.10903.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=99789&code=amFuYWthLm4ucmFuYXRodW5nYUBnbWFpbC5jb218OTk3ODl8MTg3OTc3NTUwOA==>
> .
> NAML
> <http://wso2-oxygen-tank.10903.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
 *Janaka Ranathunga* * Senior Software Engineer*
  Tel: +94 11 256 9150  | Mobile: +94 71 168 3232
 [email protected]
<https://www.facebook.com/janaka.n.ranathunga>
<http://lk.linkedin.com/in/janakaranathunga>
<https://plus.google.com/+janakaranathunga>




--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-Problems-sending-numeric-keys-in-JSON-Payloads-tp99789p100277.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to