如何从Request XML中为给定的soap Web服务找到WSDL URL?

时间:2016-11-28 16:55:49

标签: groovy soapui

我必须找出WSDL URL来获取webservice中存在的方法的定义,以便我可以使用数据。

  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:met="http://schemas.esb.ams.com/meterusagesource">
<soapenv:Header/>
<soapenv:Body>
<met:processMeterUsage>
<MeterUsageReqList>
<userId>JONBREZON</userId>
<userType>THRD</userType>
<reportTypeArray>

<reportFormat>CSV</reportFormat>
<ESIIDArray>
<!--1 or more repetitions:-->
<ESIID>1008901022900060000000</ESIID>
</ESIIDArray>
</MeterUsageReqList>
</met:processMeterUsage>
</soapenv:Body>
</soapenv:Envelope>

2 个答案:

答案 0 :(得分:0)

您似乎已发布来自网络服务的请求

WSDL具有不同的格式,您无法从请求中获取它。

也许你必须以其他方式寻找网址而不是你在这里分享的代码。

也许此链接对您有用

WSDL定义:http://www.w3schools.com/xml/xml_wsdl.asp

肥皂请求定义:http://www.w3schools.com/xml/xml_soap.asp

答案 1 :(得分:0)

假设测试用例有两个测试步骤,即

  • step1,肥皂请求测试步骤
  • step2,groovy脚本测试步骤;在这里你需要访问step1的端点。

这是 Groovy脚本

//Getting the step1 using its index 0, change if need to suite your environment  
​def step = context.testCase.getTestStepAt(0)
//Get the endpoint of step1
def endPoint = step.getPropertyValue('Endpoint')​
//log the value
log.info "End point of step1 is ${endPoint}"