使用机器人框架的肥皂调用



我正在尝试通过机器人框架实现肥皂调用测试。尝试了我在谷歌上可以找到的各种解决方案,但没有任何效果。

当我通过 SOAP UI 进行测试时,也是如此。我错过了什么,我不确定。

new test
[Tags]               abcd
Add Doctor Import    http://schemas.xmlsoap.org/soap/encoding/
&{headers}=          Create Dictionary                            Content-Type                                                                                     text/xml                                                            SOAPAction             ""                    Host    bfx-b2b....
${auth}=             Create List                                  Test                                                                                    Password3#
Create Session       getPlans                                     https://bfx-b2b.../wsdl/ProductService.wsdl    auth=${auth}                                                        verify=True
${file_data}=        Get Binary File                              ${CURDIR}/request.xml
Log                  ${file_data}
${byte_string}=      Encode String To Bytes                       ${REQUEST}                                                                                       UTF-8
${resp}=             Post Request                                 getPlans                                                                                         https://bfx-b2b..../B2BWEB/services/IProductPort    data=${byte_string}    headers=${headers}
Log                  ${resp.text}
Log                  ${resp.status_code}

我的响应错误低于 500。

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
ESS_eBiz_Operations@uhc.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

几个肥皂 UI 细节 -

我在 SOAP UI 上点击的端点 -https://bfx-b2b.../B2BWEB/services/IProductPort原始数据-

POST https://bfx-b2b.../B2BWEB/services/IProductPort HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 1822
Host: bfx-b2b...
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Cookie: SMCHALLENGE=YES
Cookie2: $Version=1
Authorization: Basic V2VsbHRoaWVfVGVzdDpQYXNzd29yZDMj

看看这个例子是否对你有帮助:

*** Settings ***
Documentation     Test with SOAP (WSDL) with two parameters that returns the country passing the IP
Library           SudsLibrary
*** Variables ***
${ip}             150.162.2.1
*** Test Cases ***
ConsultaIP
Create Soap Client    http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl
${result}    Call Soap Method    ResolveIP    ${ip}    null
${country}    Get Wsdl Object Attribute    ${result}    Country
${Latitude}    Get Wsdl Object Attribute    ${result}    Latitude
${Longitude}    Get Wsdl Object Attribute    ${result}    Longitude
log    The IP ${ip} belongs to the country ${country}, Latitude: ${Latitude} Longitude: ${Longitude}

最新更新