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

I was asked to fill out some documentation related to multiple web services in an application and specify for each service if implemented using JAX-WS or JAX-RPC. The services have been developed over the years and probably using various methods, including the built-in web service wizard in RAD, and the use of wsimport called from Maven. And they have changed and evolved over time - even in some cases where there were original documents saying the service was one or the other, I'm not sure how much to trust them.

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

+3


source to share


1 answer


If you see @WebService

in the Java source, this is definitely a JAX-WS service class. JAX-WS uses a combination of native annotations and uses JAXB annotations ( @XmlType

in pojos) to serialize / deserialize Java to / from XML.



If you see webservices.xml

or XML files in a web module whose names seem to map to well-known web service names and might look like this example , these are JAX-RPC services. JAX-RPC uses reflection and mapping files to convert a limited set of Java types to and from XML. You can even search / grep the codebase for XML namespace values ​​like 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 most likely help you in services implemented using JAX-RPC.

+3


source







All Articles