开发者

wsdl2java and soap with attachments issue

开发者 https://www.devze.com 2023-04-02 10:06 出处:网络
I generated a WS Client using wsdl2java for a Soap service developed with soaplib 0.8.2 (python). The server does support Soap with attachments as I could see with tcpdump while using a client built a

I generated a WS Client using wsdl2java for a Soap service developed with soaplib 0.8.2 (python). The server does support Soap with attachments as I could see with tcpdump while using a client built al开发者_如何学JAVAso with soaplib. But when it comes to Java, the generated client does not send the attachments as other parts, but embedded in the xml as base64 binaries.

I'd like to know how the java client could be set up in order to send the attachments as parts and not embedded in the xml?


you need to set

stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);

please refer this blog[1] for more details.

[1] http://amilachinthaka.blogspot.com/2009/01/using-mtom-with-axis2.html

0

精彩评论

暂无评论...
验证码 换一张
取 消