Wrapper vs Bare (Non-wrapper)
来源:互联网 发布:惠州网络运行 编辑:程序博客网 时间:2024/05/04 06:33
Wrapper和Bare不是WSDL定义的某种标准,而是JAX-WS和JAX-RPC定义的两种代码组织方式。只有document/literal才有Wrapper和Bare的形式,RPC不存在这种分别。
document/literal/wrapper
document/literal/bare
RPC/literal - 这种方式是WS-I BP支持的,但是在实际使用中已经不推荐了。
同样一个WSDL定义文件可以同时生成Wrapper和Bare方式的两套代码。它们的差别只在代码的格式上。参见JAX-WS 2.0 specification 2.3.1.3 Example 或如下代码。对于Wrapper方式,JAX-WS通过SOAP消息中root element的名字来查找方法(它们的名字必须是一致的),而Bare方式则是通过方法参数的类型来匹配的。通过Bare方式匹配的方法的参数必须和SOAP消息里的XML binding的数据类型是一致的。所以Wrapper方式不支持在SEI (Service Endpoint Interface) 中有Overloaded的方法(同名不同参数),而Bare方式同样不支持SEI中有同参数不同名的方法。
<!-- WSDL extract -->
<types>
<xsd:element name="setLastTradePrice">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="tickerSymbol" type="xsd:string"/>
<xsd:element name="lastTradePrice" type="xsd:float"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="setLastTradePriceResponse">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
</types>
<message name="setLastTradePrice">
<part name="setLastTradePrice" element="tns:setLastTradePrice"/>
</message>
<message name="setLastTradePriceResponse">
<part name="setLastTradePriceResponse" element="tns:setLastTradePriceResponse"/>
</message>
<portType name="StockQuoteUpdater">
<operation name="setLastTradePrice">
<input message="tns:setLastTradePrice"/>
<output message="tns:setLastTradePriceResponse"/>
</operation>
</portType>
// non-wrapper style mapping
SetLastTradePriceResponse setLastTradePrice(
SetLastTradePrice setLastTradePrice);
// wrapper style mapping
void setLastTradePrice(String tickerSymbol, float lastTradePrice);
http://myarch.com/wrappernon-wrapper-web-service-styles-things-you-need-to-know
- Wrapper vs Bare (Non-wrapper)
- Wrapper
- wrapper
- wrapper class
- Protocol Wrapper
- Wrapper类
- Spring Wrapper
- Luna Wrapper
- class Wrapper
- TCP Wrapper
- tcp wrapper
- Gradle Wrapper
- 知识库--Wrapper
- Gradle Wrapper
- Maven Wrapper
- tcp wrapper
- wrapper容器
- gradle wrapper
- 我的卓越英语之路-第13天
- 让“连接被重置”去见鬼——如何稳定地使用Google搜索
- 恶搞英语大厅的原理(准确来说应该是恶搞IE)
- Sicily 1754 逃离洞穴
- 2012新年
- Wrapper vs Bare (Non-wrapper)
- POJ 1860 Currency Exchange
- 针对Excel表格文件操作的编程实现
- 怎样写简历
- 使用ActivityGroup来切换Activity和Layout
- POJ 3660 Cow Contest
- Sicily 1779 Fibonacci Sequence Multiplication
- Amazon Dynamo的相关材料
- POJ2828 Buy Tickets