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
How to test fileupload using SOAP UI
提问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 .
内容应该是内联的。
采纳答案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
- Create a new Project
- Create a TestSuite in the Project
- Create a TestCase in the TestSuite
- 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)
- In the Request Editor add the File you want to upload to the Attachments tab
- Set the Media-Type of the POST Body to the same as the Content-Type of the attached File
- Send the request!
- 创建一个新项目
- 在项目中创建一个TestSuite
- 在 TestSuite 中创建一个 TestCase
- 向测试用例添加 HTTP 测试请求步骤
- 将端点设置为要上传到的 URL
- 将方法设置为 POST(或 PUT)
- 在请求编辑器中,将要上传的文件添加到附件选项卡
- 将 POST Body 的 Media-Type 设置为与附加文件的 Content-Type 相同
- 发送请求!