Вопрос

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 also 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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top