0 0

SOAP 消息传输3

记得SOAP消息中. 有encodingStyle属性.
w3school 给出的解释是 :
encodingStyle 属性
SOAP 的 encodingStyle 属性用于定义在文档中使用的数据类型。此属性可出现在任何 SOAP 元素中,并会被应用到元素的内容及元素的所有子元素上。SOAP 消息没有默认的编码方式。 语法为 encodingStyle = "SOAP1.1/SOAP1.2/soap-encoding URI"


我的理解是. 该属性只有wsdl文档中规定  SOAP 绑定的格式为encoded 时例如.
<soap:body use="encoded" encodingStyle="SOAP1.1/SOAP1.2/soap-encoding URI" namespace="http://temp"/>
才能在soap消息中使用. 但是请问在soap消息中. 什么地方用到了这个属性才有意义呢???
比如
   <soapenv:Body>
      <pub:PostInfo  soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <test:addr xsi:type="test:Address" xmlns:test="http://test">
            <test:zip xsi:type="xsd:string">12</test:zip>
         </test:addr>
         <usezip xsi:type="xsd:boolean">true</usezip>
      </pub:PostInfo>
   </soapenv:Body>
在上面的SOAP消息中.我发现 soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 加了和
不加效果都是一样的. ws服务器都能正常解析.

PS: 我知道encoded已经被移出了JAXWS规范. 但是还是知道上面问题的答案. 
2012年2月06日 09:16
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics