SOAP Body 元素
}&]2y'JnkJ5H0XH0
7K/O1hb0a-z.k0
必需的 SOAP Body 元素可包含打算传送到消息最终端点的实际 SOAP 消息。
.]1Ax^1ij$kG0
]&tm]Pn{0
SOAP Body 元素的直接子元素可以是合格的命名空间。SOAP 在默认的命名空间中("http://www.w3.org/2001/12/soap-envelope")定义了 Body 元素内部的一个元素。即 SOAP 的 Fault 元素,用于指示错误消息。51Testing软件测试网@g-A.l)A;_yU%M
51Testing软件测试网 i w'h,MZ
<?xml version="1.0"?>
9y\%N)I]q_0
<soap:Envelope51Testing软件测试网1t0T8XQ#K
Yo
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"51Testing软件测试网;\d~__ Z/B5_+Z
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">51Testing软件测试网VB'dU2H5\O
51Testing软件测试网o4a^~UTbd
<soap:Body>51Testing软件测试网"K|3UW.@Lc
<m:GetPrice xmlns:m="http://www.w3school.com.cn/prices">51Testing软件测试网5@HJ'B;P
C(n1n r
<m:Item>Apples</m:Item>51Testing软件测试网p-Xw Kq[S1FN6M7}
</m:GetPrice>
k SI+cfq{S,d0
</soap:Body>51Testing软件测试网W0K6Q)|9U:O
1Tt1f+tT4s-eA'T6N$i0
</soap:Envelope>上面的例子请求(Request)苹果的价格。请注意,上面的 m:GetPrice 和 Item 元素是应用程序专用的元素。它们并不是 SOAP 标准的一部分。51Testing软件测试网:dQ6T6w tee7{y3S
51Testing软件测试网DC-@0_I:Qc(EV
而一个 SOAP 响应(Reponse)应该类似这样:
\(d[;p4v)@ d/n0
b|
F}Bl0
<?xml version="1.0"?>51Testing软件测试网8nu z$cE
<soap:Envelope
#Z#sX4OE,o_)b0
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"51Testing软件测试网\`YsG v
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
Q3_8oF wnTt"X0
51Testing软件测试网 B,|^!^@)d
<soap:Body>51Testing软件测试网t{"P%Uu~a`
<m:GetPriceResponse xmlns:m="http://www.w3school.com.cn/prices">
+_ ef~.U0
<m:Price>1.90</m:Price>
5K,wR/?:bx3WY,D0
</m:GetPriceResponse>
V
DxJ2hHDt0
</soap:Body>51Testing软件测试网n$u5Iu4p/@
^sU%[\"Oz0
</soap:Envelope>51Testing软件测试网:@5jkC3e2xOJ9}