SOAP 封套

来源:互联网 发布:手机淘宝咸鱼在哪找 编辑:程序博客网 时间:2024/03/28 18:53

 SOAP 封套

作者:w3pop.com 翻译/整理:w3pop.com
<script type="text/javascript"><!--google_ad_client = "pub-7906861952969058";google_alternate_color = "ffffff";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "006699";google_color_text = "EEEEEE";google_color_url = "FFFFFF";//--></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>

The mandatory SOAP Envelope element is the root element of a SOAP message.
具有强制性的SOAP封套(Envelope)元素是SOAP信息的根元素。


The SOAP Envelope Element
SOAP封套元素

The required SOAP Envelope element is the root element of a SOAP message. It defines the XML document as a SOAP message.
必要的SOAP封套元素是SOAP元素的根元素。它把XML文件定义为SOAP信息。

Note the use of the xmlns:soap namespace. It should always have the value of:
注意xmlns:soap命名空间(namespace)的使用。它一般含有以下值:

http://www.w3.org/2001/12/soap-envelope

and it defines the Envelope as a SOAP Envelope:
它以SOAP 封套(Envelope)的形式定义了封套(Envelope)。

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
Message information goes here
...
</soap:Envelope>


The xmlns:soap Namespace
xmlns:soap命名空间

A SOAP message must always have an Envelope element associated with the "http://www.w3.org/2001/12/soap-envelope" namespace.
SOAP信息必须含有与"http://www.w3.org/2001/12/soap-envelope" 命名空间相关的Envelope元素。

If a different namespace is used, the application must generate an error and discard the message.
如果使用了不同的命名空间,那应用程序肯定会产生一个错误信息并忽略信息。


The encodingStyle Attribute
encodingStyle属性

The SOAP encodingStyle attribute is used to define the data types used in the document. This attribute may appear on any SOAP element, and it will apply to that element's contents and all child elements. A SOAP message has no default encoding.
SOAPencodingStyle属性的作用:定义用于文档中的数据类型。属性可能会在任何SOAP元素中出现,并且会应用于元素的内容及其所有子元素上。SOAP信息没有默认编码。

Syntax
语法

soap:encodingStyle="URI"

Example
实例

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"

soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
Message information goes here
...
</soap:Envelope>
<script type="text/javascript"><!--google_ad_client = "pub-7906861952969058";google_alternate_color = "ffffff";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as";google_ad_type = "text_image";google_ad_channel = "";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "006699";google_color_text = "EEEEEE";google_color_url = "FFFFFF";//--></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
 
原创粉丝点击