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

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

SOAP Body


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

The mandatory SOAP Body element contains the actual SOAP message.
强制使用的 SOAP Body 元素包含了实际的SOAP信息。


The SOAP Body Element
Soap主体元素

The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message.
必需的 SOAP Body 元素可包含打算传送到消息最终端点的实际 SOAP 消息。

Immediate child elements of the SOAP Body element may be namespace-qualified. SOAP defines one element inside the Body element in the default namespace ("http://www.w3.org/2001/12/soap-envelope"). This is the SOAP Fault element, which is used to indicate error messages.
SOAP Body 元素的直接子元素可以是合格的命名空间。SOAP 在默认的命名空间中("http://www.w3.org/2001/12/soap-envelope")定义了 Body 元素内部的一个元素。即 SOAP 的 Fault 元素,用于指示错误消息。

<?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:Body> <m:GetPrice xmlns:m="http://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice>
</soap:Body>
</soap:Envelope>

The example above requests the price of apples. Note that the m:GetPrice and the Item elements above are application-specific elements. They are not a part of the SOAP standard.
上面的例子请求苹果的价格。请注意,上面的 m:GetPrice 和 Item 元素是应用程序专用的元素。它们并不是 SOAP 标准的一部分。

A SOAP response could look something like this:
而一个 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:Body> <m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse>
</soap:Body>
</soap:Envelope>

评论 (0) All

登陆 | 还没注册?