简体   繁体   中英

WSO2 ESB can not response json message

I have a service response is :

<Response>
    <BackUrl>www.hao123.com</url>
    <resultCode>0</resultCode>
</Response>

I set messageType:"application/json" . The response is:

{Response:{"BackUrl":"coship.com","resultCode":"0";}}.

But I need transform this message to a json string like:

{"BackUrl":"http://www.coship.com","resultCode":"0"}

How ro remove node "Response". I tried to use script mc.setPayloadJSON in ESB 4.5.1. But errors happened.

https://wso2.org/jira/browse/ESBJAVA-1618?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel#issue-tabs

Anyone can help me? Thank you very much.

There is an issue reported as mentioned, and it is not resolved yet. But, you can set messgae type as

<property name="messageType" value="application/json" scope="axis2"/>  

and check?

here is a post which may useful to you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM