SOAP Building Blocks
SOAP 组件群
A SOAP message is an ordinary XML document containing the following elements:
一条 SOAP 消息就是一个普通的 XML 文档,包含下列元素:
- A required Envelope element that identifies the XML document as a SOAP message
必需的 Envelope 元素,可把此 XML 文档标识为一条 SOAP 消息 - An optional Header element that contains header information
可选的 Header 元素,包含头部信息 - A required Body element that contains call and response information
必需的 Body 元素,包含所有的调用和响应信息 - An optional Fault element that provides information about errors that occurred while processing the message
可选的 Fault 元素,提供有关在处理此消息所发生错误的信息
All the elements above are declared in the default namespace for the SOAP envelope:
所有以上的元素均被声明于针对 SOAP 封装的默认命名空间中:
http://www.w3.org/2001/12/soap-envelope
and the default namespace for SOAP encoding and data types is:
以及针对 SOAP 编码和数据类型的默认命名空间:
http://www.w3.org/2001/12/soap-encoding
Syntax Rules
语法规则
Here are some important syntax rules:
下面是一些重要的语法规则:
- A SOAP message MUST be encoded using XML
SOAP 消息必须用 XML 来编码 - A SOAP message MUST use the SOAP Envelope namespace
SOAP 消息必须使用 SOAP Envelope 命名空间 - A SOAP message MUST use the SOAP Encoding namespace
SOAP 消息必须使用 SOAP Encoding 命名空间 - A SOAP message must NOT contain a DTD reference
SOAP 消息不能包含 DTD 引用 - A SOAP message must NOT contain XML Processing Instructions
SOAP 消息不能包含 XML 处理指令
Skeleton SOAP Message
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"> <soap:Header> ... ... </soap:Header> <soap:Body> ... ... <soap:Fault> ... ... </soap:Fault> </soap:Body> </soap:Envelope> |