如何实现向后兼容的soap webservice(基于java)? [英] How to implement backward compatible soap webservice (java based)?

查看:239
本文介绍了如何实现向后兼容的soap webservice(基于java)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的一个产品使用契约最后一种方法发布了一个Web服务。这已成为一个真正的问题,因为我们的所有客户(ws客户)必须在我们发布新版本的产品后立即重建其客户端应用程序。这是因为所有命名空间更改都是自动生成的wsdls的成本。我们将Axis1用于javatowsdl。我一直在寻找一个好的方法/工具来开发向后兼容的webservice。

One of our product publishes a webservice using contract-last approach. This has becoming a real problem as all of our clients (ws clients) have to rebuild their client apps as soon as we release a new version of our product. This is due to all namespace changes that comes as a cost with auto-generated wsdls. We use Axis1 for javatowsdl. I've been seeking for a good methodology/ tool to develop backward compatible webservice for this.

即。版本9.3客户端仍然可以点击10.0服务,因为他们会错过一些功能,这很好。但它们应该能够在不破坏的情况下发挥作用。

i.e. version 9.3 clients can still hit the 10.0 service, of cause they will miss some of the functionality, that is fine. But they should be able to function without breaking.

我明白整个问题是由于我们的合约最后一种方法(如果我错了,请纠正我)。因此,如果解决方案是采用契约优先的Web服务,我可以使用哪些工具和技术?合同优先的最佳做法是什么?

I do understand the whole problem is due to our contract last approach (Pls. correct me if I'm wrong). Therefore, if the solution is to go for contract-first webservice what are the tools and technologies I could use? Also what are the best practises around contract-first?

提前致谢。

推荐答案

正如您已经意识到的那样,建议使用契约优先(或自上而下)方法来开发Web服务。这意味着手动定义WSDL接口,并使用自动工具基于此文档生成Web服务的Java Skeleton。

As you already realized, the recommendation is to use a Contract-First (or Top-Down) approach to develop Web Services. That implies a manual definition of your WSDL interface and generate a Java Skeleton of the Web Service based on this document using automatic tools.

重要的是您的WSDL符合< a href =http://www.ws-i.org/ =nofollow> WS-I标准,以确保不同平台上的客户端之间的互操作性。您可以使用 SOAP-UI 来测试您的WSDL是否与标准兼容。

Is important that your WSDL complies to the WS-I standart to assure interoperability between clients on different platforms. You can use SOAP-UI to test whether your WSDL is compatible with the standard or not.

对于Skeleton生成,您可以使用几个Web Service Runtime API:如Apache Axis和JAX-WS。我个人更喜欢JAX-WS,因为它是Java标准版,并且得到所有Java EE容器的支持。每个容器都为Skeleton一代提供工具,Weblogic有一些不错的 Ant任务,但也有 WS-导入即容器中性。

For the Skeleton generation, there are several Web Service Runtime API's that you can use: Like Apache Axis and JAX-WS. I personally prefer JAX-WS because is a Java Standard and is supported by all Java EE Containers. Each container provides tools for the Skeleton generation, Weblogic has some nice Ant Task for that but there's also WS-Import that is Container neutral.

这篇关于如何实现向后兼容的soap webservice(基于java)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆