简体   繁体   中英

How to determine if a Java web service is JAX-WS or JAX-RPC

I've been asked to complete some documentation related to a number of web services in an application and indicate for each service if it as implemented using JAX-WS or JAX-RPC. The services have been developed over a number of years, and probably using a variety of methods including the built in web-service wizard in RAD, as well as using wsimport, called from Maven. And they've changed and evolved over time as well - even in some cases where there was original documents saying that the service was one or the other, I'm not sure how much they can be trusted.

Are there any clear markers to let me know if a service is JAX-WS or JAX-RPC? I have full access to the source code, WSDLs and schemas. I'm just not 100% sure what to look for.

If you see @WebService in the Java source, that's certainly a JAX-WS service class. JAX-WS uses a combination of its own annotations and leverages JAXB annotations ( @XmlType in pojos) for serializing/deserializing Java to/from XML.

If you see webservices.xml or XML files in a web module whose names seem to map to known web service names and that may look like this example , those are JAX-RPC services. JAX-RPC uses reflection and mapping files to convert a limited set of Java types to and from XML. You may even be able to search/grep the codebase for XML namespace values such as http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd or http://java.sun.com/xml/ns/jax-rpc/ri/config to find such mapping files - their names will likely guide you to the services implemented with JAX-RPC.

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