开发者

SOAP Request/Response based on Style/Use

开发者 https://www.devze.com 2023-03-12 15:45 出处:网络
I was wondering if someone could explain the differences in a SOAP request/response of a Web service with the following wsdl binding style/use:

I was wondering if someone could explain the differences in a SOAP request/response of a Web service with the following wsdl binding style/use:

  1. Document/literal
  2. RPC/literal
  3. wrapped document style

Thanks in ad开发者_Python百科vance


This article from IBM DeveloperWorks [Which style of WSDL should I use?] has an excellent explanation of the differences between these binding styles. In a nutshell, the only differences are the values of the SOAP binding "style" attribute ("rpc" or "document") in the WSDL file and the way the message arguments and return values are defined (and thus how they appear in the SOAP messages themselves):

[Note the reordering of items from the question to emphasize relationships]

  1. RPC/literal - WSDL message element defines arguments and return value(s) of operations.
    • PROS: simple WSDL, operation name appears in SOAP message, WS-I compliant.
    • CONS: difficult to validate since arguments are defined in WSDL not XSD.
  2. Document/literal - WSDL message parts are references to elements defined in XML Schema.
    • PROS: easily validated with XSD, WS-I compliant but allows breakage.
    • CONS: complicated WSDL, SOAP message does not contain operation name.
  3. Document/literal wrapped (or "wrapped document style") - WSDL message input has single input and output parameters and input refers to XSD element with same local name as WSDL operation.
    • PROS: easily validated, SOAP message contains operation name, WS-I compliant.
    • CONS: most complicated WSDL (not an official style but a convention).

In my experience, #3 (Document/literal Wrapped) is very common in large enterprise projects because it is both Microsoft and OSS friendly and it is well suited for a top-down development model (e.g. WSDL/XSD first, then generate code artifacts). Microsoft invented it [1] and popular Java/OSS tools (Axis2, JAX-WS) support it explicitly.

The "real world" difference likely comes down to which styles are supported — and how well — by the tools of your choice.

0

精彩评论

暂无评论...
验证码 换一张
取 消