51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4978|回复: 1
打印 上一主题 下一主题

[原创] lr 8.1 webservice 调用方法(难)?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-4-25 13:43:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本地添加web service 一个cmcc_mas_wbs.wsdl文件
在Run-time settings设置Web service toolkit(Toolk Options) 选择了两个:General/MS SOAP分别运行脚本,结果如下:

采用:General
运行该方法后,出现错误:

Virtual User Script started
Starting action vuser_init.
Web Services replay version 8.1.0 for WINXP; Toolkit: "Vugen"; WebServices78 build 959
Run-Time Settings file: "C:\Documents and Settings\kangzhanwen\Local Settings\Temp\noname20\\default.cfg"
Vuser directory: "C:\Documents and Settings\kangzhanwen\Local Settings\Temp\noname20"
Vuser output directory: "C:\Documents and Settings\kangzhanwen\Local Settings\Temp\noname20\"
LOCAL start date/time:  2008-04-22 10:17:13
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(6): Web service call "sendSms_105" started
Action.c(6): Using working copy of the WSDL file "http://192.168.0.18/services/cmcc_mas_wbs?wsdl"
Action.c(6): Using client emulation General
Action.c(6): Removed Web headers not matching the emulated client
Action.c(6): "Content-Type: text/xml; charset=utf-8" header registered for adding to requests from the immediately following Action function          [MsgId: MMSG-26506]
Action.c(6): "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.573)" header registered for adding to requests from the immediately following Action function    [MsgId: MMSG-26506]
Action.c(6): "SOAPAction: "http://www.csapi.org/service/sendSms"" header registered for adding to requests from the immediately following Action function       [MsgId: MMSG-26506]
Action.c(6): t=526ms: Connecting to host 192.168.0.18:80         [MsgId: MMSG-26000]
Action.c(6): t=532ms: Connected socket from 192.168.0.59:1980 to 192.168.0.18:80 in 3 ms           [MsgId: MMSG-26000]
Action.c(6): t=535ms: 360-byte request headers for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(6):     POST /services/cmcc_mas_wbs HTTP/1.1\r\n
Action.c(6):     Content-Type: text/xml; charset=utf-8\r\n
Action.c(6):     Cache-Control: no-cache\r\n
Action.c(6):     User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.57
Action.c(6):     3)\r\n
Action.c(6):     SOAPAction: "http://www.csapi.org/service/sendSms"\r\n
Action.c(6):     Accept-Encoding: gzip, deflate\r\n
Action.c(6):     Accept: */*\r\n
Action.c(6):     Connection: Keep-Alive\r\n
Action.c(6):     Host: 192.168.0.18\r\n
Action.c(6):     Content-Length: 621\r\n
Action.c(6):     \r\n
Action.c(6): t=623ms: 621-byte request body for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(6):     <?xml version="1.0"  encoding="UTF-8" standalone="no"?><soap:Envelope xmlns:soap="http://s
Action.c(6):     chemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x
Action.c(6):     mlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><sendSmsRequest xmlns="http://www.c
Action.c(6):     sapi.org/schema/sms"><ApplicationID>P111111111111111</ApplicationID><DestinationAddresses>
Action.c(6):     tel:15801385629</DestinationAddresses><ExtendCode>01</ExtendCode><Message>testestestestese
Action.c(6):     t</Message><MessageFormat>GB2312</MessageFormat><SendMethod>Normal</SendMethod><DeliveryRe
Action.c(6):     sultRequest></DeliveryResultRequest></sendSmsRequest></soap:Body></soap:Envelope>
Action.c(6): t=711ms: 187-byte response headers for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(6):     HTTP/1.1 500 Internal Server Error\r\n
Action.c(6):     Server: Apache-Coyote/1.1\r\n
Action.c(6):     Content-Type: text/xml;charset=utf-8\r\n
Action.c(6):     Transfer-Encoding: chunked\r\n
Action.c(6):     Date: Tue, 22 Apr 2008 02:02:04 GMT\r\n
Action.c(6):     Connection: close\r\n
Action.c(6):     \r\n
Action.c(6): t=823ms: 5-byte chunked response overhead for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(6):     241\r\n
Action.c(6): t=847ms: 577-byte chunked response body for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(6):     <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmls
Action.c(6):     oap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www
Action.c(6):     .w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.us
Action.c(6):     erException</faultcode><faultstring>org.xml.sax.SAXException: Invalid element in org.csapi
Action.c(6):     .www.schema.sms.SendSmsRequest - ApplicationID</faultstring><detail><ns1:hostname xmlns:ns
Action.c(6):     1="http://xml.apache.org/axis/">localhost.localdomain</ns1:hostname></detail></soapenv:Fau
Action.c(6):     lt></soapenv:Body></soapenv:Envelope>
Action.c(6): t=952ms: 7-byte chunked response overhead for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(6):     \r\n
Action.c(6):     0\r\n
Action.c(6):     \r\n
Action.c(6): t=1006ms: Closing connection to server 192.168.0.18 because server indicated that the connection should be closed           [MsgId: MMSG-26000]
Action.c(6): t=1018ms: Closed connection to 192.168.0.18:80 after completing 1 request        [MsgId: MMSG-26000]
Action.c(6): t=1031ms: Request done "http://192.168.0.18/services/cmcc_mas_wbs"    [MsgId: MMSG-26000]
Action.c(6): Error: The reason for the SOAP fault is:       "org.xml.sax.SAXException: Invalid element in org.csapi.www.schema.sms.SendSmsRequest - ApplicationID"
Action.c(6): Notify: Saving Parameter "response = <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException: Invalid element in org.csapi.www.schema.sms.SendSmsRequest - ApplicationID</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">localhost.localdomain</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>"
Action.c(6): Error: Web service call "sendSms_105" execution failed
Action.c(6): Continuing after error in Vuser script.
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.

运行后出现错误,各位高手帮我分析一下。。急!!!!!

[ 本帖最后由 kangwen615 于 2008-4-25 13:53 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2008-4-25 13:43:45 | 只看该作者
采用:MS SOAP
Virtual User Script started
Starting action vuser_init.
Web Services replay version 8.1.0 for WINXP; Toolkit: "Vugen"; WebServices78 build 959
Run-Time Settings file: "C:\Documents and Settings\kangzhanwen\Local Settings\Temp\noname23\\default.cfg"
Vuser directory: "C:\Documents and Settings\kangzhanwen\Local Settings\Temp\noname23"
Vuser output directory: "C:\Documents and Settings\kangzhanwen\Local Settings\Temp\noname23\"
LOCAL start date/time:  2008-04-22 10:37:55
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(4): Web service call "sendSms_106" started
Action.c(4): Using working copy of the WSDL file "http://192.168.0.18/services/cmcc_mas_wbs?wsdl"
Action.c(4): Using client emulation MSSOAP
Action.c(4): Removed Web headers not matching the emulated client
Action.c(4): "Content-Type: text/xml; charset=utf-8" header registered for adding to requests from the immediately following Action function          [MsgId: MMSG-26506]
Action.c(4): "User-Agent: SOAP Toolkit 3.0" header registered for adding to requests from the immediately following Action function           [MsgId: MMSG-26506]
Action.c(4): "SOAPAction: "http://www.csapi.org/service/sendSms"" header registered for adding to requests from the immediately following Action function       [MsgId: MMSG-26506]
Action.c(4): t=566ms: Connecting to host 192.168.0.18:80         [MsgId: MMSG-26000]
Action.c(4): t=574ms: Connected socket from 192.168.0.59:2078 to 192.168.0.18:80 in 3 ms           [MsgId: MMSG-26000]
Action.c(4): t=581ms: 296-byte request headers for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(4):     POST /services/cmcc_mas_wbs HTTP/1.1\r\n
Action.c(4):     Content-Type: text/xml; charset=utf-8\r\n
Action.c(4):     Cache-Control: no-cache\r\n
Action.c(4):     User-Agent: SOAP Toolkit 3.0\r\n
Action.c(4):     SOAPAction: "http://www.csapi.org/service/sendSms"\r\n
Action.c(4):     Accept-Encoding: gzip, deflate\r\n
Action.c(4):     Accept: */*\r\n
Action.c(4):     Connection: Keep-Alive\r\n
Action.c(4):     Host: 192.168.0.18\r\n
Action.c(4):     Content-Length: 654\r\n
Action.c(4):     \r\n
Action.c(4): t=685ms: 654-byte request body for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(4):     <?xml version="1.0"  encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="
Action.c(4):     http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins
Action.c(4):     tance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><tns:sendSmsRequest xml
Action.c(4):     ns:tns="http://www.csapi.org/schema/sms"><ApplicationID>P111111111111111</ApplicationID><D
Action.c(4):     estinationAddresses>tel:15801385629</DestinationAddresses><ExtendCode>1</ExtendCode><Messa
Action.c(4):     ge>testestestestestest</Message><MessageFormat>GB2312</MessageFormat><SendMethod>Normal</S
Action.c(4):     endMethod><DeliveryResultRequest></DeliveryResultRequest></tns:sendSmsRequest></SOAP-ENV:B
Action.c(4):     ody></SOAP-ENV:Envelope>
Action.c(4): t=781ms: 187-byte response headers for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(4):     HTTP/1.1 500 Internal Server Error\r\n
Action.c(4):     Server: Apache-Coyote/1.1\r\n
Action.c(4):     Content-Type: text/xml;charset=utf-8\r\n
Action.c(4):     Transfer-Encoding: chunked\r\n
Action.c(4):     Date: Tue, 22 Apr 2008 02:22:46 GMT\r\n
Action.c(4):     Connection: close\r\n
Action.c(4):     \r\n
Action.c(4): t=874ms: 5-byte chunked response overhead for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(4):     1fb\r\n
Action.c(4): t=894ms: 507-byte chunked response body for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(4):     <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmls
Action.c(4):     oap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www
Action.c(4):     .w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.us
Action.c(4):     erException</faultcode><faultstring>java.lang.NullPointerException</faultstring><detail><n
Action.c(4):     s1:hostname xmlns:ns1="http://xml.apache.org/axis/">localhost.localdomain</ns1:hostname></
Action.c(4):     detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
Action.c(4): t=966ms: 7-byte chunked response overhead for "http://192.168.0.18/services/cmcc_mas_wbs" (RelFrameId=1)
Action.c(4):     \r\n
Action.c(4):     0\r\n
Action.c(4):     \r\n
Action.c(4): t=1008ms: Closing connection to server 192.168.0.18 because server indicated that the connection should be closed           [MsgId: MMSG-26000]
Action.c(4): t=1017ms: Closed connection to 192.168.0.18:80 after completing 1 request        [MsgId: MMSG-26000]
Action.c(4): t=1026ms: Request done "http://192.168.0.18/services/cmcc_mas_wbs"    [MsgId: MMSG-26000]
Action.c(4): Error: The reason for the SOAP fault is:       "java.lang.NullPointerException"
Action.c(4): Notify: Saving Parameter "response = <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>java.lang.NullPointerException</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">localhost.localdomain</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>"
Action.c(4): Error: Web service call "sendSms_106" execution failed
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.

跟上面一样的错误
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-16 04:55 , Processed in 0.072747 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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