- 博客(0)
- 资源 (1)
- 收藏
- 关注
Building a JSON web service with Java
1.Download Axis2 as WAR and install it in your servlet container
2.Download the DynamicResponseHandler module and add it to Axis by copying it to WEB-INF/modules
3.Patch Jettison or download my patched version and replace it with the one installed in WEB-INF/lib
4.Add the DynamicResponseHandler module reference to the axis2.xml configuration (located in WEB-INF/conf):
<module ref="DynamicResponseHandler"/>
5.Add the JSON Message formatters to the axis2.xml:
<messageFormatter contentType="application/json" class="org.apache.axis2.json.JSONMessageFormatter"/>
<messageFormatter contentType="application/json/badgerfish" class="org.apache.axis2.json.JSONBadgerfishMessageFormatter"/>
6.Add JSON Message builders to the axis2.xml:
<messageBuilder contentType="application/json" class="org.apache.axis2.json.JSONOMBuilder"/>
<messageBuilder contentType="application/json/badgerfish" class="org.apache.axis2.json.JSONBadgerfishOMBuilder"/>
7. Start your servlet container and test the standard version service by calling this url:
http://localhost:8080/axis2/services/Version/getVersion?response=application/json
2013-04-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人