51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2869|回复: 15
打印 上一主题 下一主题

[求助] 关于webserveice测试

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2006-3-21 15:51:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
第一次使用webservices协议,测试可执行程序,开始录制后,exe程序不能被启动。
怎么才能正常启动程序呢?

在线等。急!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2006-3-21 16:26:52 | 只看该作者
你是选择的“Record Client Application”吗?选择“Scan WSDL file”方式,试试

[ 本帖最后由 笑游天涯侠 于 2006-3-21 16:31 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2006-3-21 17:59:41 | 只看该作者
两个选项都试过了。都不能启动exe程序。
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2006-3-22 13:13:02 | 只看该作者
选择“scan wsdl file”选项,生成脚本。运行的时候log 如下:

Virtual User Script started
Starting action vuser_init.
vuser_init.c(4): web_service_call "searchSales_101" started.
vuser_init.c(4): using client emulation General
vuser_init.c(4): web headers not matching emulated client removed.
vuser_init.c(4): Error: server returned an incorrectly formatted SOAP response
vuser_init.c(4): Error: web_service_call "searchSales_101" execution failed
Abort was called from an action.


请问是哪里出了问题? 请大家帮忙看看!

[ 本帖最后由 wonder80 于 2006-3-22 13:52 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2006-3-22 14:08:37 | 只看该作者
web_service_call 调用"searchSales_101"时,有这个错误提示"web headers not matching emulated client removed.",检查一下是什么原因。
最好自己写整个测试脚本。
回复 支持 反对

使用道具 举报

该用户从未签到

6#
 楼主| 发表于 2006-3-22 17:10:23 | 只看该作者
我看可很多遍,都没有找出问题,以下是我的wsdl文件,能帮忙看看么?

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://192.168.0.147:7001/ticketWEB/services/Ticket" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://192.168.0.147:7001/ticketWEB/services/Ticket" xmlns:intf="http://192.168.0.147:7001/ticketWEB/services/Ticket" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="Ticket" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
<wsdl:types>
  <schema targetNamespace="Ticket" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://192.168.0.147:7001/ticketWEB/services/Ticket"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="SearchSalesForm">
    <sequence>
     <element name="ev_event_name" nillable="true" type="soapenc:string"/>
     <element name="pe_time" nillable="true" type="soapenc:string"/>
     <element name="sa_p_code" nillable="true" type="soapenc:string"/>
     <element name="sa_start_time" nillable="true" type="soapenc:string"/>
     <element name="ve_region_name" nillable="true" type="soapenc:string"/>
     <element name="ve_venue_code" nillable="true" type="soapenc:string"/>
     <element name="ve_venue_name" nillable="true" type="soapenc:string"/>
    </sequence>
   </complexType>
   <complexType name="SearchSalesView">
    <sequence>
     <element name="pe_perf_name" nillable="true" type="soapenc:string"/>
     <element name="pe_time" nillable="true" type="soapenc:string"/>
     <element name="sa_p_code" nillable="true" type="soapenc:string"/>
     <element name="sa_status" nillable="true" type="soapenc:string"/>
     <element name="se_member_discnt_f" nillable="true" type="soapenc:string"/>
     <element name="se_price" nillable="true" type="soapenc:string"/>
     <element name="se_seat_sale_type" nillable="true" type="soapenc:string"/>
     <element name="se_seat_type" nillable="true" type="soapenc:string"/>
     <element name="ve_venue_name" nillable="true" type="soapenc:string"/>
    </sequence>
   </complexType>
  </schema>
  <schema targetNamespace="http://192.168.0.147:7001/ticketWEB/services/Ticket" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="Ticket"/>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_tns1_SearchSalesView">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:SearchSalesView[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>
</wsdl:types>

   <wsdl:message name="searchSalesResponse">

      <wsdl:part name="searchSalesReturn" type="impl:ArrayOf_tns1_SearchSalesView"/>

   </wsdl:message>

   <wsdl:message name="searchSalesRequest">

      <wsdl:part name="searchSalesForm" type="tns1:SearchSalesForm"/>

   </wsdl:message>

   <wsdl:portType name="TicketService">

      <wsdl:operation name="searchSales" parameterOrder="searchSalesForm">

         <wsdl:input message="impl:searchSalesRequest" name="searchSalesRequest"/>

         <wsdl:output message="impl:searchSalesResponse" name="searchSalesResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="TicketSoapBinding" type="impl:TicketService">

      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="searchSales">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="searchSalesRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.0.147:7001/ticketWEB/services/Ticket" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="searchSalesResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.0.147:7001/ticketWEB/services/Ticket" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="TicketServiceService">

      <wsdl:port binding="impl:TicketSoapBinding" name="Ticket">

         <wsdlsoap:address location="http://192.168.0.147:7001/ticketWEB/services/Ticket"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>




以下是我的lr脚本:

vuser_init()
{

        web_service_call( "StepName=searchSales_102",
                "SOAPMethod=TicketServiceService.TicketService.searchSales",
                "ResponseParam=response",
                "WSDL=D:/Work/PIA/exe/test.wsdl",
                "Snapshot=t1143015847.inf",
                BEGIN_ARGUMENTS,
                "xml:searchSalesForm=<searchSalesForm><ev_event_name></ev_event_name><pe_time>"
                                "</pe_time><sa_p_code></sa_p_code><sa_start_time></sa_start_time><ve_region_name>"
                                "</ve_region_name><ve_venue_code></ve_venue_code><ve_venue_name></ve_venue_name>"
                                "</searchSalesForm>",
                END_ARGUMENTS,
                BEGIN_RESULT,
                END_RESULT,
                LAST);

        lr_think_time(3);



        return 0;
}


请各位帮忙看看!
回复 支持 反对

使用道具 举报

该用户从未签到

7#
发表于 2006-3-22 18:44:32 | 只看该作者
你脚本中都没有指定参数值,是不是有些参数必须要指定输入值呀?
回复 支持 反对

使用道具 举报

该用户从未签到

8#
 楼主| 发表于 2006-3-23 09:57:37 | 只看该作者
这是测试一个检索功能。不输入检索条件试,是无条件检索,检索出所有的数据。

[ 本帖最后由 wonder80 于 2006-3-23 09:59 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

9#
发表于 2006-3-23 10:18:39 | 只看该作者
如果你用的是lr8.0,最好先打上lr8.0的web services的补丁。
你在run-time settings里的log,选择extended log,包括其下的每一项,再回放,看看错误的具体原因。
如果实在还搞不定,那就直接写http脚本,因为web services call只是一种特殊的http请求。具体该怎么写脚本,你可以参考我在论坛发表的“lr下web services测试总结二”
回复 支持 反对

使用道具 举报

该用户从未签到

10#
 楼主| 发表于 2006-3-23 17:37:09 | 只看该作者
研究了一下午的soap请求,然后根据我的wsdl(前面贴的),写了个soap请求。不知道是否正确。能帮忙看看么?

<soap:Envelope   xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema/">
         
         <soap:Body>  
            <searchSales xmlns="TicketServiceService.TicketService">
               ev_event_name=
               pe_time=
              sa_p_code=
              sa_start_time=
              ve_region_name=
              ve_venue_code
              ve_venue_name="  
            </searchSales>
         </soap:Body>
</soap:Envelope>


另外,soap请求中需要通过soap:Header追加TransactionID么?这个值有是怎么取得呢?
回复 支持 反对

使用道具 举报

该用户从未签到

11#
 楼主| 发表于 2006-3-24 14:02:01 | 只看该作者
大家帮忙看看吧  先谢谢了
回复 支持 反对

使用道具 举报

该用户从未签到

12#
发表于 2006-3-24 14:50:48 | 只看该作者
嗨,你这个根本就不需要soap:Header,这个东东是根据你的格式文件来的。
给你一个最简单的例子:
Action()
{
char soapBody[1024] = "SOAPEnvelope=<soap:Envelope  xmlns:soap="
     "\"http://schemas.xmlsoap.org/soap/envelope/\"\n  xmlns:xsi="
     "\"http://www.w3.org/2001/XMLSchema-instance\"\n  xmlns:xsd="
     "\"http://www.w3.org/2001/XMLSchema\">"
     "\n<soap:Body>"  
     "\n<test xmlns=\"http://www.monternet.com/dsmp/schemas/\">"
     "\n<a>19</a>"
     "\n</test>"
     "\n </soap:Body>"
     "\n</soap:Envelope>";

   
     web_add_header("SOAPAction","http://www.monternet.com/dsmp/schemas/test");

     soap_request("StepName=OrderReq",
     "URL=http://test1/wapprovision/provision.asmx",
     soapBody,
    "Snapshot=t1.inf",
    "ResponseParam=result",
    LAST);


        return 0;
}
回复 支持 反对

使用道具 举报

该用户从未签到

13#
 楼主| 发表于 2006-3-28 11:34:15 | 只看该作者
能不能把你例子中用的格式文件wsdl文件 给我看看啊。
因为对于如何取url,test 这些变量的值,不是很清楚!sdlkfj想仔细了解一下。
先谢了sdlkfj

[ 本帖最后由 wonder80 于 2006-3-28 11:41 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

14#
发表于 2006-3-28 14:59:24 | 只看该作者
你的wsdl文件是你写的吗?
<wsdlsoap:operation soapAction=""/>这句感觉有点问题呀,
你的soapAction为空?
并把所有的<wsdlsoap:换成<soap:
然后试试。
回复 支持 反对

使用道具 举报

该用户从未签到

15#
发表于 2006-5-18 17:35:15 | 只看该作者
“lr下web services测试总结二” 中Web Services的HTTP请求脚本开发中的url具体指的是什么啊
回复 支持 反对

使用道具 举报

该用户从未签到

16#
发表于 2006-5-18 22:01:23 | 只看该作者
我之前做webserveice测试是用loadrunner调用XMLSPY进行的。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-21 20:30 , Processed in 0.086550 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表