Java 如何使用 SOAP UI 测试文件上传

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4051816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 11:00:17  来源:igfitidea点击:

How to test fileupload using SOAP UI

javasoapfile-uploadwebservice-client

提问by

How to test fileupload using SOAP UI.

如何使用 SOAP UI 测试文件上传。

There is a service which accepts file as input I want to simulate that using SOAP UI
It gives me .

有一个服务接受文件作为输入我想模拟它使用 SOAP UI
它给了我 .

content should be inline .

内容应该是内联的。

alt text

替代文字

采纳答案by Brian Clements

Here are some docs on using attachments in soapUI.

这里有一些关于在 soapUI 中使用附件的文档。

http://www.soapui.org/SOAP-and-WSDL/adding-headers-and-attachments.html

http://www.soapui.org/SOAP-and-WSDL/adding-headers-and-attachments.html

From Ole in the eviware forum

来自 eviware 论坛中的 Ole

  1. Create a new Project
  2. Create a TestSuite in the Project
  3. Create a TestCase in the TestSuite
  4. Add an HTTP TestRequest Step to the TestCase
    • Set the endpoint to the URL you want to upload to
    • Set the method to POST (or PUT)
  5. In the Request Editor add the File you want to upload to the Attachments tab
  6. Set the Media-Type of the POST Body to the same as the Content-Type of the attached File
  7. Send the request!
  1. 创建一个新项目
  2. 在项目中创建一个TestSuite
  3. 在 TestSuite 中创建一个 TestCase
  4. 向测试用例添加 HTTP 测试请求步骤
    • 将端点设置为要上传到的 URL
    • 将方法设置为 POST(或 PUT)
  5. 在请求编辑器中,将要上传的文件添加到附件选项卡
  6. 将 POST Body 的 Media-Type 设置为与附加文件的 Content-Type 相同
  7. 发送请求!