2017-10-12 53 views
0

我试图测试将接受某个请求的端点。需要5分钟才能完成请求的发起过程,因此我想将其复制到SOAP-UI中。我不知道如何让请求看起来像下面这样。如何在SOAP-UI中复制复合POST

Host: somedomain.net 
User-Agent: Jakarta; Commons-HttpClient/3.0.1 
--7ZRj4zj5nzTkWtBlwkO5Y4Il-En_uTGP2enCIMn 
Content-Disposition: form-data; name="companyId" 
Content-Type: text/plain; charset=US-ASCII 
Content-Transfer-Encoding: 8bit 

985 
--7ZRj4zj5nzTkWtBlwkO5Y4Il-En_uTGP2enCIMn 
Content-Disposition: form-data; name="inputFormData" 
Content-Type: text/plain; charset=US-ASCII 
Content-Transfer-Encoding: 8bit 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><response>Response XML Data</response> 
--7ZRj4zj5nzTkWtBlwkO5Y4Il-En_uTGP2enCIMn 
Content-Disposition: form-data; name="completedAgreement"; filename="48ce7fa4079790440a964815a744d232.zip" 
Content-Type: application/octet-stream; charset=ISO-8859-1 
Content-Transfer-Encoding: binary 

PK 

任何帮助,将不胜感激。

回答

0

我无法在SOAP-UI中重新创建,但我能够创建一个简单的html表单来完成工作。

<html> 
<head> 
    <meta charset="utf-8" /> 
    <title></title> 
</head> 
<body> 
    <form action="/api/receiver" method="post" enctype="multipart/form-data"> 
     <p> 
      Company Id:<br /> 
      <input type="text" value="725" name="companyId" /> 
     </p> 
     <p> 
      Input Form Data:<br /> 
      <textarea name="inputFormData" rows="10" cols="50"> 
      </textarea> 
     </p> 
     <p> 
      Completed Agreement:<br /> 
      <input type="file" name="completedAgreement" /> 
     </p> 
     <p> 
      <input type="submit" value="submit" /> 
     </p> 
    </form> 
</body> 
</html> 

最重要的部分是在form标签设置enctypeenctype="multipart/form-data"