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

[StepbyStep]: Notes for WDSL - 实例分析

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

    public class WS_MyService1 : System.Web.Services.WebService
cX8Z"P!_QX$l0    {
51Testing软件测试网tJ"tO3f2[%n

        [WebMethod]
2f5o7F,N:?;K;il-G9?DU0        public string _print(string _str)
4u@*Bjr1JWt0        {
$ws&\(Dy;e9[8g0            return _str;
v6g)^v&W(\'n0        }51Testing软件测试网-]FE2p@3d3L^I
    }
51Testing软件测试网{ nr/JB0V(G

以上是一个WebService中的一个类。以下是其对应WDSL的片段,51Testing软件测试网 X4L m7VA5J$L"a/N+TY

<wsdl:message name="_printSoapIn">

we(jER0

<wsdl:part name="parameters" element="tns:_print" />

}e? o D&{:FH-c^l0

</wsdl:message>51Testing软件测试网@~"x|rK

 51Testing软件测试网 nr(de/P8U+~*O7p

<wsdl:message name="_printSoapOut">

I&h1YQ S7a^6q0

        <wsdl:part name="parameters" element="tns:_printResponse" />

2@]8z|-G|1Ve\N#X0

</wsdl:message>51Testing软件测试网5j[m1t-VJw

 51Testing软件测试网F0`o1Z8i$}

<wsdl:portType name="WS_MyService1Soap">

q?N}9M\v0

<wsdl:operation name="_print">51Testing软件测试网i^ |sXR'_

<wsdl:input message="tns:_printSoapIn" /> 51Testing软件测试网^/a;@miNEQ

<wsdl:output message="tns:_printSoapOut" /> 51Testing软件测试网t^(du4y@(n

</wsdl:operation>51Testing软件测试网VvcE:H

</wsdl:portType>

Bg#oE$Y*zh;^ J9j3v0

 51Testing软件测试网q?&R!E"Rsy!H^

分析:51Testing软件测试网"KZ2cbp-Fm

 51Testing软件测试网|9V,\)PtS

l  <portType> 元素把 " WS_MyService1Soap " 定义为某个端口的名称,把 "_print " 定义为某个操作的名称。操作 " _print " 拥有一个名为 "_printSoapIn" 的输入消息,以及一个名为 "_printSoapOut " 的输出消息。

.}U*Je6z j#^mK0

l  <message> 元素可定义每个消息的部件,以及相关联的数据类型。对比传统的编程,WS_MyService1Soap是一个函数库,而 "_print " 是带有输入参数 "_printSoapIn" 和返回参数_printSoapOut的一个函数。51Testing软件测试网;r\B8P[*S p P


TAG: 测试技术

 

评分:0

我来说两句

Open Toolbar