如何使用soapUI 测试 MTOM Web 服务?

发布于 2024-08-17 06:46:20 字数 1619 浏览 6 评论 0原文

我构建了一个包装 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

楠木可依 2024-08-24 06:46:20

以下是对我有用的方法:

  • 首先,设置请求属性以启用 MTOM

在此处输入图像描述

  • 然后,当您收到回复时,打开附件选项卡并单击小按钮(见图)导出附件

在此处输入图像描述

Here is what worked for me:

  • First, set your request properties to enable MTOM

enter image description here

  • Then, when you get response, open attachments tab and click tiny button (see picture) to export attachment

enter image description here

痴情 2024-08-24 06:46:20

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文