当前位置: 首页 > 网络学院 > XML相关教程 > SOAP > SOAP Envelope

SOAP
SOAP 介绍
SOAP 语法
SOAP Envelope
SOAP Header
SOAP Body
SOAP Fault
SOAP HTTP Binding
SOAP 实例
SOAP 总结

SOAP Envelope


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 746 ::
收藏到网摘: n/a

The mandatory SOAP Envelope element is the root element of a SOAP message.
强制使用的 SOAP 的封套(Envelope)元素是一条 SOAP 信息的根元素。


The SOAP Envelope Element
SOAP Envelope 元素

The required SOAP Envelope element is the root element of a SOAP message. It defines the XML document as a SOAP message.
必需的 SOAP 的 Envelope 元素是 SOAP 消息的根元素。它可把 XML 文档定义为 SOAP 消息。

Note the use of the xmlns:soap namespace. It should always have the value of:
请注意 xmlns:soap 命名空间的使用。它的值应当始终是:

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

and it defines the Envelope as a SOAP Envelope:
并且它可把封装定义为 SOAP 封装:

<?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.
SOAP 的 encodingStyle 属性用于定义在文档中使用的数据类型。此属性可出现在任何 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>

评论 (0) All

登陆 | 还没注册?