51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2877|回复: 2
打印 上一主题 下一主题

[求助] 用web_custom_request协议发送soap报文的问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-8-20 18:33:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位大家好,我有个项目,需要用编写脚本用soap协议,发送报文到服务器,我分别用soap_request函数和web_custom_request函数发送报文,soap_request可以发送,但是web_custom_request不行,而soap_request虽然能发送但是返回的报文不好解析,原来用 lr_xml_get_values函数解析,后来看到说这个函数的性能很低,所以想换web_custom_request发送,用web_reg_save_param来解析。但是不成功,现在把代码贴出来各位帮忙看看:
soap_request发送:
soap_request("StepName=SOAP Request",                                                                                
                "URL=http://192.16.21.178:7811/SelfHelp/AgentServer",                                                                                
                "SOAPEnvelope="
                "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"ns:fwbs\">"
                        "<soapenv:Header></soapenv:Header>"
                        "<soapenv:Body>"
                                "<ns:agentPay>"
                                        "<feetype>13</feetype>"
                                        "<tlrno>0394</tlrno>"
                                        "<custno>45113904</custno>"
                                        "<hbrno>10004</hbrno>"
                                        "<channel>selfHelp</channel>"
                                        "<qfbs>1</qfbs>"
                                        "<txamt>702.00</txamt>"
                                        "<cashflg>1</cashflg>"
                                        "<actno>6223920001101146592</actno>"
                                        "<NotCheckPasswd>1</NotCheckPasswd>"
                                        "<TXTYPE>0</TXTYPE>"
                                        "<passwd></passwd>"
                                "</ns:agentPay>"
                        "</soapenv:Body>"
                "</soapenv:Envelope>",                                                                                
                "SOAPAction=AgentServer",        
                "ExpectedResponse=AnySoap",
                "ResponseParam=result",                                                                                
                "Snapshot=t1376963486.inf",                                                                           
                LAST);

web_custom_request发送:

        web_add_header("Content-Type","text/xml; charset=utf-8");
        web_add_header("Accept","application/soap+xml, application/dime,multipart/related, text/*");
        web_add_header("Cache-Control","no-cache");
        web_add_header("Pragma","no-cache");
        web_add_header("SOAPAction","AgentServer");
   
        web_custom_request("AgentServer",
        "URL=http://192.16.21.178:7811/SelfHelp/AgentServer",
        "Method=POST",
        "Resource=0",
        "RecContentType=text/xml",
        "Mode=HTML",
        "EncType=text/xml; charset=utf-8",
        "Body=<?xml version=\"1.0\"encoding=\"UTF-8\" standalone=\"no\"?>"
        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"ns:fwbs\">"
                        "<soapenv:Header></soapenv:Header>"
                        "<soapenv:Body>"
                                "<ns:agentPay>"
                                        "<feetype>13</feetype>"
                                        "<tlrno>0394</tlrno>"
                                        "<custno>45113904</custno>"
                                        "<hbrno>10004</hbrno>"
                                        "<channel>selfHelp</channel>"
                                        "<qfbs>1</qfbs>"
                                        "<txamt>702.00</txamt>"
                                        "<cashflg>1</cashflg>"
                                        "<actno>6223920001101146592</actno>"
                                        "<NotCheckPasswd>1</NotCheckPasswd>"
                                        "<TXTYPE>0</TXTYPE>"
                                        "<passwd></passwd>"
                                "</ns:agentPay>"
                        "</soapenv:Body>"
                "</soapenv:Envelope>",
                LAST);
不成功,报错信息为:
Action.c(16): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://192.16.21.178:7811/SelfHelp/AgentServer"          [MsgId: MERR-26612]
Action.c(16): web_custom_request("AgentServer") highest severity level was "ERROR", 2658 body bytes, 181 header bytes          [MsgId: MMSG-26388]
怎么都解决不了,也加了web_api.h        
各位大大,帮忙看看
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2013-8-21 13:01:25 | 只看该作者
如果是500错误,那多半还是发送的soap消息本身有错误。用soapui测试一下,确保消息本身正确。
回复 支持 反对

使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    3#
    发表于 2013-8-31 20:45:02 | 只看该作者
    还是内容有问题
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-9-27 12:28 , Processed in 0.088773 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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