我试图读取SoapUI mockService收到的PresentationID xml值,我发送一个POST请求:
<?xml version="1.0" encoding="UTF-8"?>
<ContentRequest xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
<PresentationID>test41</PresentationID>
</ContentRequest>
我可以看到我发送的请求有效负载是正确的“Content-Type”标头是application / xml
但在SoapUI中,这些将始终打印:null
log.info mockRequest.getContentElement()
log.info mockRequest.requestContent
log.info mockRequest.getRequestXmlObject()
我读了两个:SoapUI getting request parameters in mock service script
transferring values from request to response (soapUI mock service)
并尝试了SoapUI教程:http://www.soapui.org/Service-Mocking/creating-dynamic-mockservices.html但尚未成功..
任何想法将不胜感激!我正在使用SoapUI 5.0.0
1 回答
我刚才有同样的问题 . 将Soap-UI更新到最新版本http://www.soapui.org/downloads/latest-release.html解决了这个问题 .
log.info mockRequest.getContentElement()仍返回null,但其他两个工作正常 .
快乐测试:)