如何禁用cxf SOAP客户端使用多部分请求

问题描述 投票:0回答:1

我必须调用不支持多部分请求的专有服务,我没有发送任何附件,但是cxf似乎创建了多部分请求

POST /endpoint HTTP/1.1
Content-Type: multipart/related; type="text/xml"; boundary="uuid:86ebef4f-fc2a-431b-a21b-37e86b4901f9"; start="<[email protected]>"; start-info="text/xml"
Accept: */*
Authorization: Basic U1dHMTAwNTA6MTIzNDU1
SOAPAction: "XYZ.0050"
User-Agent: Apache-CXF/3.3.6
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:8082
Connection: keep-alive
Content-Length: 2134


--uuid:86ebef4f-fc2a-431b-a21b-37e86b4901f9
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
[etc...]

我注意到一个非多部分的请求工作正常

POST /endpoint HTTP/1.1
Content-Type: text/xml;charset=UTF-8
Accept: */*
Authorization: Basic U1dHMTAwNTA6MTIzNDU1
Cache-Control: no-cache
Connection: keep-alive
Host: localhost:8082
Pragma: no-cache
SOAPAction: "XYZ.0050"
User-Agent: Apache-CXF/3.3.6
Content-Length: 2114

[etc...]

如何强制cxf使用非多部分请求?

java soap cxf multipart cxf-client
1个回答
0
投票

好像cxf每当有@XmlAttachmentRef / DataHandler属性时都会创建一个多部分,在我的情况下,它从未使用过,因此我从类中删除了它。

© www.soinside.com 2019 - 2024. All rights reserved.