简体   繁体   中英

How to parse SOAP response in JAX-WS?

How should i parse SOAP response? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM