Can I have a look at your camel route ?
Which data format did you choice for the CXF endpoint ?


On Sat Sep 24 15:29:05 2011, Shayanthan Kanaganayagham wrote:
I'm developing an CXF web service in ServiceMix 4.2. In the web-service
output need to send an xml output in the body. I created cxf endpoint and
defined the routes to generate the output.
If the result have atleast two child elements under its root tag( CXFOutput
), the output XML will produce in a proper manner in the response soap
message body.
Sample :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
    <soap:Body>
       <getCompleteItemNumberResponse xmlns="
http://postmarque.proiam.com/ivrsnumber/ws/domain";>
          <OUTPUT><![CDATA[<?xml version=”1.0” encoding=”utf-8” ?>
                 <CXFOutput Input_No = “123456789” Record_Count = “2”
Return_Code = “000” Return_Msg = “Success”>
                     <  Item_No = “ER123456789SG”/>
                     <  Item_No = “EA123456789FR”/>
                 </CXFOutput>]]>
         </OUTPUT>
       </getCompleteItemNumberResponse>
    </soap:Body>
</soap:Envelope>

But the result XML will encoded as '&lt;' for '<' in the response soap body
when the root (CXFOutput) have zero child elements.

Sample :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
    <soap:Body>
       <getCompleteItemNumberResponse xmlns="
http://postmarque.proiam.com/ivrsnumber/ws/domain";>
          <OUTPUT>&lt;![CDATA[&lt;?xml version=”1.0” encoding=”utf-8” ?>
                 &lt;CXFOutput Input_No = “123456789” Record_Count = “2”
Return_Code = “000” Return_Msg = “Success”/>]]>
         </OUTPUT>
       </getCompleteItemNumberResponse>
    </soap:Body>
</soap:Envelope>

How can I solve this unwanted encoding problem in the XML output inside the
soap body. I have tried to Intercept the result and try to format the
output, but that also failed.




--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
        http://jnn.javaeye.com (Chinese)
Twitter: willemjiang Weibo: willemjiang

Reply via email to