1
A
回答
0
是的,这是可能的。 首先,您可以使用SOAP ui来模拟您期望的附件响应。 [在soap资源上,右键单击:生成SOAP模拟服务] 在创建的模拟上,响应中应该会看到与wsld相对应的虚拟主体。在那里你可以点击附件并添加一个文件: 你运行这个模拟并尝试用肥皂请求手动点击它,然后应该出现在请求部分。
它会为您生成附件的回复。 您可以看到原始的部分看起来像这样:
Content-Type: multipart/related; type="application/xop+xml"; start="<[email protected]>"; start-info="text/xml"; boundary="----=_Part_19_678369072.1513344309074",
MIME-Version: 1.0
------=_Part_19_678369072.1513344309074
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getFileResponse xmlns:ns3="urn:eu:europa:ec:etrustex:integration:service:notification:v2.0" xmlns:ns2="urn:eu:europa:ec:etrustex:integration:service:filerepository:v2.0" xmlns="urn:eu:europa:ec:etrustex:integration:model:common:v2.0">
<ns2:fileWrapper>
<Content><inc:Include href="cid:test.txt" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></Content>
</ns2:fileWrapper>
</ns2:getFileResponse>
</S:Body>
</S:Envelope>
------=_Part_19_678369072.1513344309074
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-ID: <test.txt>
Content-Disposition: attachment; name="test.txt"
TEST
------=_Part_19_678369072.1513344309074--
现在,你可以设置wiremock像这样的东西:
{
"request": {
"method": "POST",
"urlPattern": "/mockFileRepository"
},
"response": {
"status": 200,
"bodyFileName": "responseTest.raw",
"headers": {
"Content-Type": "multipart/related; type=\"application/xop+xml\"; start=\"<[email protected]>\"; start-info=\"text/xml\"; boundary=\"----=_Part_19_678369072.1513344309074\"",
"MIME-Version": "1.0"
}
}
}
注重标题内容类型应该是一样的你从肥皂用户那里得到的原料。
的responseTest.raw看起来是这样的:
------=_Part_19_678369072.1513344309074
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getFileResponse xmlns:ns3="urn:eu:europa:ec:etrustex:integration:service:notification:v2.0" xmlns:ns2="urn:eu:europa:ec:etrustex:integration:service:filerepository:v2.0" xmlns="urn:eu:europa:ec:etrustex:integration:model:common:v2.0">
<ns2:fileWrapper>
<Content><inc:Include href="cid:test.txt" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></Content>
</ns2:fileWrapper>
</ns2:getFileResponse>
</S:Body>
</S:Envelope>
------=_Part_19_678369072.1513344309074
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-ID: <test.txt>
Content-Disposition: attachment; name="test.txt"
TEST
------=_Part_19_678369072.1513344309074--
瞧!
相关问题
- 1. wiremock soap ws-policy支持?
- 2. C#中带附件(SwA)的SOAP#
- 3. SOAP带附件/ MIME内容
- 4. 如何使用SOAP附件?
- 5. wsdl2java和soap附件问题
- 6. 在CF中使用SOAP +附件
- 7. 使用apache axis2的SOAP附件
- 8. 使用Linux的SOAP MTOM附件CURL
- 9. 带附件的ColdFusion SOAP响应
- 10. SOAP文件中的PDF文件(不作为附件)
- 11. Axis2/Axiom处理SOAP MTOM /非MTOM附件
- 12. SOAP附件未到达服务器端
- 13. SOAP附件和数据处理程序
- 14. iOS - 如何使用SOAP发送附件?
- 15. Wiremock的存根URL
- 16. Wiremock not recording
- 17. 从SOAP附件中获取ZIP文件损坏
- 18. 附件中的附件
- 19. WireMock为datadriven模拟?
- 20. Wiremock Stubbing不工作
- 21. Wiremock CORS不工作
- 22. Wiremock猬失败的升级
- 23. 多值的queryString在Wiremock
- 24. 解决wireMock中的动态路径
- 25. 如何从SOAP响应中提取多部分附件
- 26. 如何在Soap-UI中附加Xml文件
- 27. PHP - 扩展SoapClient以处理SWA(带附件的SOAP)
- 28. 从.NET 3.5到PHP Web服务的SOAP附件
- 29. WireMock。忽略我开始WireMock作为独立的进程只有一个
- 30. WireMock意外返回空
那么你使用MTOM? – ThomasRS
是的,我是。在我的响应对象中,它存储为'org.apache.axis.attachments.AttachmentPart'。 –
那么附件是内置还是外置? – ThomasRS