为什么在契约优先 SOAP 服务中从 XSD(而不是 WSDL)开始?
Why start from XSD (rather than WSDL) in contract-first SOAP-service?
在此 Spring 参考(第 3 章。编写契约优先 Web 服务)
http://docs.spring.io/spring-ws/site/reference/html/tutorial.html
它说
"A service contract is generally expressed as a WSDL file. Note that in Spring-WS, writing the WSDL by hand is not required. Based on the XSD and some conventions, Spring-WS can create the WSDL for you..."
这也是示例应用中实现的方法:
https://github.com/spring-guides/gs-soap-service.git
只是想知道...如果您这样做 "contract first",您为什么要从 XSD 开始并让框架生成 WSDL?
我认为 "contract first" 作为最佳实践背后的想法是让您最大限度地控制界面,
确保不同 SOAP 服务框架、工具、语言等之间的最大兼容性
虽然 XSD 包含数据类型和 request/response 对象类型,但它没有定义实际的服务操作(也许还有其他一些东西?)...
在 XSD 中未定义的内容中,您是否会遇到不同工具之间不兼容的风险?
希望对此做出一些澄清...
我使用 spring-ws 的主要原因。 WSDL 可以由 Spring 动态生成。这是非常有利的,考虑到它包含端点(在景观之间是不同的)。通常使用基数 XSD 来定义常用的数据元素。此外,在定义 XSD 之后,您可以使用 jaxb 为源代码生成必要的 class 文件。
如您所见,通过定义 XSD 并由此生成 class 文件。您的代码库正在成为合法的 Web 服务。
请看这个比较:
https://dzone.com/articles/apache-cxf-vs-apache-axis-vs
"Isn't there a risk that you will encounter incompatibilities between different tools in the stuff that is NOT defined in the XSD?"
基本上,Spring 所做的是让您通过代码定义服务,并使用从 XSD 生成的域对象。我想你在那边不会有问题。
但是,根据我目前的经验,由于 Spring 不完全兼容 JAX-WS,您可能会遇到一些实施问题,尤其是当您与第 3 方团队合作时。例如,spring-ws 不支持相同的命名方法和 属性 个对象。
除此之外,它的设置和使用非常简单
在此 Spring 参考(第 3 章。编写契约优先 Web 服务)
http://docs.spring.io/spring-ws/site/reference/html/tutorial.html
它说 "A service contract is generally expressed as a WSDL file. Note that in Spring-WS, writing the WSDL by hand is not required. Based on the XSD and some conventions, Spring-WS can create the WSDL for you..."
这也是示例应用中实现的方法:
https://github.com/spring-guides/gs-soap-service.git
只是想知道...如果您这样做 "contract first",您为什么要从 XSD 开始并让框架生成 WSDL? 我认为 "contract first" 作为最佳实践背后的想法是让您最大限度地控制界面, 确保不同 SOAP 服务框架、工具、语言等之间的最大兼容性
虽然 XSD 包含数据类型和 request/response 对象类型,但它没有定义实际的服务操作(也许还有其他一些东西?)...
在 XSD 中未定义的内容中,您是否会遇到不同工具之间不兼容的风险?
希望对此做出一些澄清...
我使用 spring-ws 的主要原因。 WSDL 可以由 Spring 动态生成。这是非常有利的,考虑到它包含端点(在景观之间是不同的)。通常使用基数 XSD 来定义常用的数据元素。此外,在定义 XSD 之后,您可以使用 jaxb 为源代码生成必要的 class 文件。
如您所见,通过定义 XSD 并由此生成 class 文件。您的代码库正在成为合法的 Web 服务。
请看这个比较: https://dzone.com/articles/apache-cxf-vs-apache-axis-vs
"Isn't there a risk that you will encounter incompatibilities between different tools in the stuff that is NOT defined in the XSD?"
基本上,Spring 所做的是让您通过代码定义服务,并使用从 XSD 生成的域对象。我想你在那边不会有问题。
但是,根据我目前的经验,由于 Spring 不完全兼容 JAX-WS,您可能会遇到一些实施问题,尤其是当您与第 3 方团队合作时。例如,spring-ws 不支持相同的命名方法和 属性 个对象。
除此之外,它的设置和使用非常简单