WSO2 how to change response from string to xml

My application response is a xml like:

<?xml version="1.0" encoding="UTF-8"?><message><header>
<TransactionID>1</TransactionID>
<Timestamp>2012-04-21 14:47:28</Timestamp>
<OpCode>BOSS_DELETE_USER_SME.CD</OpCode>
<MsgType>RESP</MsgType>
<ReturnCode>3001</ReturnCode>
<ErrorMessage>???????</ErrorMessage> </header><body/></message>

But in ESB,the response like :

&lt ;?xml version="1.0" encoding="UTF-8"?&gt ;&lt ;message&gt ;&lt ;header&gt ; &lt ;TransactionID&gt ;1&lt ;/TransactionID&gt ; &lt ;Timestamp&gt ;2012-04-21 14:47:28&lt ;/Timestamp&gt ; &lt ;OpCode&gt ;BOSS_DELETE_USER_SME.CD&lt ;/OpCode&gt ; &lt ;MsgType&gt ;RESP&lt ;/MsgType&gt ; &lt ;ReturnCode&gt ;3001&lt ;/ReturnCode&gt ; &lt ;ErrorMessage&gt ;???????&lt ;/ErrorMessage&gt ; &lt ;/header&gt ;&lt ;body/&gt ;&lt ;/message&gt ;

How to set in outSequence? I have tried use contentType and messageType,but no use.

Best regards.


What is the content type of the response message?( Looks like it is not text/xml. You may use the tcpmonitor to find that out. ) If the content type is found, then you can set the correct message formatter in axis2.xml. (ie application/xml formatter).

链接地址: http://www.djcxy.com/p/29832.html

上一篇: 如何读取和写入XML文档节点值?

下一篇: WSO2如何更改从字符串到xml的响应