珍惜现在的每一分钟,全力以赴自己的梦想。 Jump for the sun, at least you land on the moon.

[StepbyStep]: Notes for SOAP 2 - SOAP元素:Body

上一篇 / 下一篇  2008-12-24 14:14:12 / 个人分类:测试技术

SOAP Body 元素

}&]2y'JnkJ5H0XH0

 

7K/O1hb0a-z.k0

必需的 SOAP Body 元素可包含打算传送到消息最终端点的实际 SOAP 消息。

.]1Ax^1ij$kG0

 

]&t m]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^~UT bd

<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-XwKq[S1FN6M7}

   </m:GetPrice>

kSI+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_8o F wnTt"X0

 51Testing软件测试网 B,|^!^@)d

<soap:Body>51Testing软件测试网t{"P%Uu~a`

   <m:GetPriceResponse xmlns:m="http://www.w3school.com.cn/prices">

+_ e f~.U0

      <m:Price>1.90</m:Price>

5K,wR/?:bx3WY,D0

   </m:GetPriceResponse>

V Dx J2hHDt0

</soap:Body>51Testing软件测试网n$u5Iu4p/@

 

^sU%[\"Oz0

</soap:Envelope>51Testing软件测试网:@5jkC3e2xOJ9}


TAG: 测试技术

 

评分:0

我来说两句

Open Toolbar