开发者

How to edit / format XML response in web service

开发者 https://www.devze.com 2023-03-21 23:47 出处:网络
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 respo

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

精彩评论

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