<binding name="MathSoapHttpBinding" type="y:MathInterface">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="Add">
<soap:operation
soapAction="http://example.org/math/#Add"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
...
</binding>
The soap:binding element indicates that this is a SOAP 1.1 binding. It also indicates the default style of service (possible values include document or rpc)
along with the required transport protocol (HTTP in this case). The soap:operation element defines the SOAPAction HTTP header value for each operation. And
the soap:body element defines how the message parts appear inside of the SOAP Body element (possible values include literal or encoded). There are other binding-specific details that can be specified this way.
Using document style in SOAP indicates that the body will contain an XML document, and that the message parts specify the XML elements that will be placed
there. Using rpc style in SOAP indicates that the body will contain an XML representation of a method call and that the message parts represent the parameters to the method.
The use attribute specifies the encoding that should be used to translate the abstract message parts into a concrete representation. In the case of
'encoded', the abstract definitions are translated into a concrete format by applying the SOAP encoding rules. In the case of 'literal', the abstract type
definitions become the concrete definitions themselves (they're 'literal' definitions). In this case, you can simply inspect the XML Schema type definitions
to determine the concrete message format.
RPC/encoded
WSDL片段:
<message name="myMethodRequest">
<part name="x" type="xsd:int"/>
<part name="y" type="xsd:float"/>
</message>
<message name="empty"/>
<portType name="PT">
<operation name="myMethod">
<input message="myMethodRequest"/>
<output message="empty"/>
</operation>
</portType>
SOAP片段:
<soap:envelope>
<soap:body>
<myMethod>
<x xsi:type="xsd:int">5</x>
<y xsi:type="xsd:float">5.0</y>
</myMethod>
</soap:body>
</soap:envelope>
RPC/literal
WSDL片段:
<message name="myMethodRequest">
<part name="x" type="xsd:int"/>
<part name="y" type="xsd:float"/>
</message>
<message name="empty"/>
<portType name="PT">
<operation name="myMethod">
<input message="myMethodRequest"/>
<output message="empty"/>
</operation>
</portType>
SOAP片段:
<soap:envelope>
<soap:body>
<myMethod>
<x>5</x>
<y>5.0</y>
</myMethod>
</soap:body>
</soap:envelope>
RPC/literal
WSDL片段:
<message name="myMethodRequest">
<part name="x" type="xsd:int"/>
<part name="y" type="xsd:float"/>
</message>
<message name="empty"/>
<portType name="PT">
<operation name="myMethod">
<input message="myMethodRequest"/>
<output message="empty"/>
</operation>
</portType>
SOAP片段:
<soap:envelope>
<soap:body>
<myMethod>
<x>5</x>
<y>5.0</y>
</myMethod>
</soap:body>
</soap:envelope>
Document/literal
WSDL片段:
<types>
<schema>
<element name="xElement" type="xsd:int"/>
<element name="yElement" type="xsd:float"/>
</schema>
</types>
<message name="myMethodRequest">
<part name="x" element="xElement"/>
<part name="y" element="yElement"/>
</message>
<message name="empty"/>
<portType name="PT">
<operation name="myMethod">
<input message="myMethodRequest"/>
<output message="empty"/>
</operation>
</portType>
SOAP片段:
<soap:envelope>
<soap:body>
<xElement>5</xElement>
<yElement>5.0</yElement>
</soap:body>
</soap:envelope>
从上面的比较可以看出,literal优于encoded的地方在于可以避免将具体的类型描述(如xsi:type="xsd:int")放在SOAP中,这可以节省不少数据流量;
Document优于RPC的地方在于它将使用Shema确定数据类型便于SOAP格式的验证,但是它却在SOAP消息中丢去了具体的方法标签,不利于服务分发层定位具体的服务实现。
鉴于上面的讨论,我们给出了一种更好的解决办法,即使用
Document/literal wrapped 模式
参考:http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
分享到:
相关推荐
Literal控件的例子
Literal控件的使用 自己在做网页的时候,总结的一点东西
天轰穿系列教程之-40HiddenField、LinkButton、Literal天轰穿系列教程之-40HiddenField、LinkButton、Literal天轰穿系列教程之-40HiddenField、LinkButton、Literal天轰穿系列教程之-40HiddenField、LinkButton、...
css-literal-loader, 将CSS标记的模板文本解析为CSS文件 css-literal-loader用于提取和处理其他文件中定义的css的web pack加载器和babel插件。"inline CSS",它只适用于 CSS 。PostCSS 。LESS 。tlb或者任何它的他...
001-glib-gdate-suppress-string-format-literal-warning.patch 001-glib-gdate-suppress-string-format-literal-warning.patch 001-glib-gdate-suppress-string-format-literal-warning.patch
选项卡的精确定位 准确的定位你想要的选项卡,如果出现的滚动条 相应的将滚动条滚动想要的内容出现在可视区域。
学习axis容器document/literal样式的好例子,值得一看。
典型的容器有 Label 控件、Literal 控件、Panel 控件和 PlaceHolder 控件。 Literal 控件与 Label 控件的区别在于 Literal 控件不向文本中添加任何 HTML 元素。(Label 控件呈现一个 span 元素。)因此,Literal ...
Literal pool examples on LandTiger
在ThinkPHP中可以使用literal标签来防止模板标签被解析,例如: 复制代码 代码如下:<literal> ”$name> value1 ”$name>value2 <else> value3 </literal> 上面的if标签被literal标签包含,因此if标签里面的内容并...
可以将 Literal 控件用作网页上其他内容的容器。Literal 控件最常用于向网页中动态添加内容。简单的讲,就是可以把 HTML 代码写到 Literal 控件上,直接呈现出来。 一、常见Literal属性 属性 描述 Text 指定 ...
template-literal-源码.rar
NULL 博文链接:https://douh.iteye.com/blog/727105
JavaScript语言中的Literal Syntax特性分析
通过示例说明document/literal、document/literal(wrapped)、rpc/encoded、rpc/literal样式的web服务对应的soap消息格式,对于理解webservice有很大好处,尤其是根据wsdl构造soap消息,非常有价值。
主要介绍了Python EOL while scanning string literal问题解决方法,本文总结出是数据库数据出现问题导致这个问题,需要的朋友可以参考下
eval函数在Python中做数据类型的转换还是很有用的。...那么eval和ast.literal_val()的区别是什么呢?本文将大家介绍关于Python中函数eval和ast.literal_eval区别的相关资料,需要的朋友可以参考下。
Test that the clearing of object literal when normalizing objects works.
ValueError: invalid literal for int() with base 10的错误 网上同样的错误有人建议用round(float(“1.0″)),但是解决不了我这个问题,round(float(“1.0″))是用于解决浮点数转换为整形数的, 而我这个则是因为...