简体   繁体   English

如何确定Java Web服务是JAX-WS还是JAX-RPC

[英]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. 我被要求完成一些与应用程序中的许多Web服务相关的文档,并指出每个服务是否使用JAX-WS或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. 这些服务已经开发了很多年,可能使用各种方法,包括RAD内置的Web服务向导,以及使用从Maven调用的wsimport。 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? 有没有明确的标记让我知道服务是JAX-WS还是JAX-RPC? I have full access to the source code, WSDLs and schemas. 我可以完全访问源代码,WSDL和模式。 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. 如果你在Java源代码中看到@WebService ,那肯定是一个JAX-WS服务类。 JAX-WS uses a combination of its own annotations and leverages JAXB annotations ( @XmlType in pojos) for serializing/deserializing Java to/from XML. JAX-WS结合使用自己的注释,并利用JAXB注释( @XmlType中的@XmlType )将Java序列化/反序列化到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. 如果您在Web模块中看到webservices.xml或XML文件,其名称似乎映射到已知的Web服务名称,并且可能看起来像这个示例 ,那么这些是JAX-RPC服务。 JAX-RPC uses reflection and mapping files to convert a limited set of Java types to and from XML. JAX-RPC使用反射和映射文件将一组有限的Java类型转换为XML或从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. 您甚至可以搜索/ grep代码库中的XML命名空间值,例如http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsdhttp://java.sun.com/xml/ns/jax-rpc/ri/config用于查找此类映射文件 - 它们的名称可能会引导您使用JAX-RPC实现的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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