开发者

How to parse SOAP response in JAX-WS?

开发者 https://www.devze.com 2023-02-09 17:44 出处:网络
How should i parse SOAP r开发者_如何学Goesponse? Do i have to write LogicalHandler (like here http://www.java-tips.org/java-ee-tips/java-api-for-xml-web-services/writing-a-handler-in-jax-ws.html) to g

How should i parse SOAP r开发者_如何学Goesponse? Do i have to write LogicalHandler (like here http://www.java-tips.org/java-ee-tips/java-api-for-xml-web-services/writing-a-handler-in-jax-ws.html) to get the payload of response and then use SAX to parse it or are there any other handy methods in JAX to do this?

I only need data from some xml tags in response?


If you use any JAX-WS implementation (CXF, Axis2, Metro) you shouldn't really have to parse responses. You can generate JAXB annotated classes from the WSDL of the web service you want to access and have marshallers to bind the XML payload to generated java beans.

0

精彩评论

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

关注公众号