1

导入 WSDL 并调用“添加服务调用”。我得到输出但是,当脚本被执行时,得到以下错误消息。错误:InvokeMethod 失败:响应不是格式良好的 XML。错误:ExtractResultArg 失败:对象引用未设置为对象的实例。

如果有人调查这个,真的很感激。

4

1 回答 1

0

我不确定如何解决您遇到的具体问题,但我可以告诉您,在测试 Web 服务时,我发现使用 WEB/HTML 协议来测试它们更加有效和有用。您可以将 web_custom_request() 直接发送到 WSDL URL。我们的开发人员使用 SOAP UI 来对 Web 服务进行单元测试,将在该工具中创建的调用(有免费版本)导入到 LR 脚本中是轻而易举的事,而无需 LR 中提供的 Web 服务协议中的很多麻烦。

这是我如何设置它的示例:

// first add whatever headers you need
web_add_header("x-ssl-client-cert","-----CERTIFICATE STRING-----");

// use web_custom_request to invoke web service
// hand code the request or use something like SOAPUI
// to record the request
web_custom_request("Your Web Service Call",
   "Method=POST",
   "URL=http://... ", \\ URL to the WSDL
   "Body=<soapenv:Envelope "
        "xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" "
        "xmlns:mul=\"http://www...\" "
        "xmlns=\"http://www....\"> "
            "   <soapenv:Header/>"
            "   <soapenv:Body>"
            " "                   // body of your request
            "   </soapenv:Body>"
            "</soapenv:Envelope>",
            "TargetFrame=",
    LAST);

改用此方法可能会带来更好的运气。

于 2013-04-25T15:52:28.607 回答