如何从给定的SOAP Web服务的请求XML中查找WSDL URL?
问题描述:
我必须找出WSDL URL来获取webservice中存在的方法的定义,以便我可以使用数据。如何从给定的SOAP Web服务的请求XML中查找WSDL URL?
<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>
答
看来你必须从发布Web服务
的WSDL具有不同的格式,你不能从请求得到它的请求。
也许你必须寻找URL的其他方式,而不是你在这里共享的代码。
也许这个链接将是有益的你
答
假设测试用例有两个测试步骤,即
- 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}"
你的意思是找到所求的终点?或者找到所有的服务操作? – Rao
@Rao请求的终点 – niran
您需要在哪里访问请求的端点?在一个groovy脚本? – Rao