English 中文(简体)
SOAP: 如何在不切断现有客户的情况下扩大类型?
原标题:SOAP: How to extend a type without breaking existing clients?

我有一个利用阿帕奇斯2实施的SOAP服务。 具有以下定义的“密码>。

<xs:complexType name="Message">
  <xs:sequence>
    <xs:element minOccurs="0" name="id" type="xs:int"/>
    <xs:element minOccurs="0" name="caption" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="text" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="source" nillable="true" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

我必须替换<代码>源码要素,并提及复杂的类别<代码>Source。 避免与现有客户分离的最佳方式是什么?

最佳回答

Martin Fowler就schema版本和推广点提供了一大篇文章。 由于你今天没有延期点,这不是你的选择。 在该行业中采用的一种做法是,在一定时间内,有不止一种版本的“世俗”和“世俗”。 因此,如果贵国的网络服务使用四个组成部分加以指定:

  1. XML Schema (xsd) describing your data model
  2. WSDL + binding describing the web service by using the XSD
  3. Service provider implemented in Java (the generated code, e.g. JAX-WS)
  4. Service implementation, somehow decoulped from #3

并且要求你进行非背后兼容的改动,你可以重复第1和第2部分,并为它们确定另一个名称空间,例如<代码>http://www.example.org/abc_v2"。 你们必须创造新的服务版本(第3号)的提供者,并在某种程度上将服务与第4部分结合起来——毫无疑问,这是很棘手的问题。

This approach works, although it is not nice as you duplicate a lot of code that wants to be maintained. If you follow this approach you should define a deadline for all clients still using version 1 of your service, so you can get rid of the duplicated code later.

最后,不要ice,而是选择。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签