珍惜现在的每一分钟,全力以赴自己的梦想。 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
IK"E x%| V k0    {
51Testing软件测试网;c7op3PZ9h

        [WebMethod]
tdC:o qM%U0        public string _print(string _str)
&E-~!{8V S A*~0        {51Testing软件测试网OP!P3l[5Q|+eL!v&\
            return _str;51Testing软件测试网;r @P6Y%n;_] D:x
        }51Testing软件测试网A6mOAzf'vNSb/A{4r
    }
51Testing软件测试网Q1@0[3V6Y_&_ ew@

以上是一个WebService中的一个类。以下是其对应WDSL的片段,

l ch"P&u0

<wsdl:message name="_printSoapIn">

Zp%l4];c ^8fa HS0

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

w%u&A R_6g6X;I*aA0

</wsdl:message>

`;XR z7M;a` W0

 51Testing软件测试网0x9L W*w~GF g0L9j

<wsdl:message name="_printSoapOut">51Testing软件测试网8H#{`k0fP [G

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

)cMznj b\0

</wsdl:message>51Testing软件测试网I Gt*GF9_t

 51Testing软件测试网 U7d*Bl1sqa

<wsdl:portType name="WS_MyService1Soap">51Testing软件测试网 ]5]U_%W

<wsdl:operation name="_print">51Testing软件测试网T0t%f2B0u O/F:|

<wsdl:input message="tns:_printSoapIn" /> 51Testing软件测试网&q#qcn#Ma4n

<wsdl:output message="tns:_printSoapOut" /> 51Testing软件测试网IZd7^&`l%` L'LI!}$T

</wsdl:operation>

JrC^ KH \ I\"Z0

</wsdl:portType>

3q2zl+|8T\g-| Q7D;X;U0

 

;Qs*obP3U2mQ8`0

分析:51Testing软件测试网%S1J:n0c[ D

 

qqR,x%Uz8B/@w0

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

.T(kc@/yU$Z$@i0

l  <message> 元素可定义每个消息的部件,以及相关联的数据类型。对比传统的编程,WS_MyService1Soap是一个函数库,而 "_print " 是带有输入参数 "_printSoapIn" 和返回参数_printSoapOut的一个函数。

2d^k3rO.F)l0

TAG: 测试技术

 

评分:0

我来说两句

Open Toolbar