开发者

How to edit / format XML response in web service

I am using Apache Axis2 to write my first web service. I am following this official link.

I observed that if you call sample StockQuoteService given in link, it gives following properly indented response :

<ns:getPriceResponse xmlns:ns="http://pojo.service.quickstart.samples/xs开发者_JAVA技巧d">
   <ns:return>42</ns:return>
</ns:getPriceResponse>  

I want response in specific XML format like

<answers>     // All answers should be in single `<answers>` tag.
  <answer> Answer1 </answer>   // Each Answer should be in `<answer>` tag.
  <answer> Answer2 </answer>
</answer>

How can I format XML response and add my XML tag ?

~Ajinkya.


You should use XSL Transformations (XSLT) to do this.


Finally got it working http://www.marcusschiesser.de/?p=142 :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜