如何使用soapUI 测试 MTOM Web 服务?
我构建了一个包装 Apache FOP 的 Web 服务。您向它发送 XML,它会为您提供包含渲染的 PDF 的 MTOM 流。现在它可以工作了,我想对其进行一些性能测试。 soapUI 说他们支持 MTOM,我将它用于所有其他 Web 服务性能测试,所以如果我不必编写自定义测试工具,那就太好了。
所以问题是:我在soapUI中得到响应,它看起来像这样:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns2:RenderDocumentResponse xmlns:ns2="http://webservices.cscinfo.com/renderService">
<ns2:Content>
<ns2:fileName xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<ns2:fileType>pdf</ns2:fileType>
<ns2:mimeType>application/pdf</ns2:mimeType>
<ns2:binaryData>JVBERAkAAiNkRUcERRkaYIMijggKNDkbEiioUBUbHrBBlE1HFwFBuWSWStGd+8ee/Nm98f935rn73P3Wfvfda6AJD8gwXCTFgJgAyhWBTh58WIjYtnYAcBDPAAA2wA4HCzs0IW+EYCmQJ82IxsmRP4F726DiD5+yrTP4zBAP+flLlZIjEAUJiM5/L42VwZF8k4PVecJbdPyZi2NE3OMErOIlmCMlaTc</ns2:binaryData>
</ns2:Content>
<ns2:message>file rendered</ns2:message>
</ns2:RenderDocumentResponse>
</soapenv:Body>
</soapenv:Envelope>
如何让soapUI为我转储和解码二进制数据?我想确保它是有效的PDF等等。 (为了简洁起见,我截断了响应中的数据,并对其进行了修改以保护有罪者!所以本文中的数据不是真正的 PDF 数据)
更新:以下是soapUI 在“原始”响应选项卡中显示的内容:
HTTP/1.1 200 OK
Date: Wed, 13 Jan 2010 17:02:31 GMT
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1
I've built a webservice that wraps Apache FOP. You send it XML, and it gives you an MTOM stream that contains the rendered PDF. Now that its working, I'd like to run some performance tests on it. soapUI says they support MTOM, and I use it for all my other webservice performance testing, so it would be great if I didn't have to write a custom test harness.
So here's the issue: I get the response back in soapUI, and it looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns2:RenderDocumentResponse xmlns:ns2="http://webservices.cscinfo.com/renderService">
<ns2:Content>
<ns2:fileName xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<ns2:fileType>pdf</ns2:fileType>
<ns2:mimeType>application/pdf</ns2:mimeType>
<ns2:binaryData>JVBERAkAAiNkRUcERRkaYIMijggKNDkbEiioUBUbHrBBlE1HFwFBuWSWStGd+8ee/Nm98f935rn73P3Wfvfda6AJD8gwXCTFgJgAyhWBTh58WIjYtnYAcBDPAAA2wA4HCzs0IW+EYCmQJ82IxsmRP4F726DiD5+yrTP4zBAP+flLlZIjEAUJiM5/L42VwZF8k4PVecJbdPyZi2NE3OMErOIlmCMlaTc</ns2:binaryData>
</ns2:Content>
<ns2:message>file rendered</ns2:message>
</ns2:RenderDocumentResponse>
</soapenv:Body>
</soapenv:Envelope>
How do I get soapUI to dump and decode the binary data for me? I want to make sure its a valid PDF and all that. (I've truncated the data in the response for brevity, and munged it to protect the guilty! So its not real PDF data in this post)
Update: here's what soapUI shows in the "raw" response tab:
HTTP/1.1 200 OK
Date: Wed, 13 Jan 2010 17:02:31 GMT
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是对我有用的方法:
Here is what worked for me:
binaryData 内容是通过 MTOM 打包返回的,还是二进制数据只是内联在消息中? (您可以在soapUI 的原始响应查看器中看到这一点)
如果它是附件,您应该在响应窗口底部的响应附件选项卡中拥有相应的附件。
如果这没有帮助,请在 eviware.com 的soapUI 论坛上提出问题,并附上原始响应消息的屏幕截图。
问候!
/奥莱
eviware.com
Is the binaryData content returned with MTOM packaging, or is the binary data just inlined in the message? (you can see this in the raw response viewer in soapUI)
If it is an attachment you should have a corresponding attachment in the response attachments tab at the bottom of the response window.
If this doesn't help please raise an issue at the soapUI forum at eviware.com and attach a screenshot of the raw response message..
regards!
/Ole
eviware.com