Hi, Alessio.
All I can find is this here:
MTOM enabled clients
Web service clients can use the same approach described above or rely on the Binding API to enable MTOM (Excerpt taken from the org.jboss.test.ws.jaxws.samples.xop.doclit.XOPTestCase):
[...]
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(MTOMEndpoint.class);
// enable MTOM
binding = (SOAPBinding)((BindingProvider)port).getBinding();
binding.setMTOMEnabled(true);
Note
You might as well use the JBossWS configuration templates to setup deployment defaults.
But it doesn't really help. I am having exception in the row
Service.create(wsdlURL, serviceName);
which is before we set MTOM. Actually I don't want to use MTOM at all but it still being loaded because WSDL has this:
<wsp:Policy wsu:Id="CustomBinding_ISearchService_policy">
<wsp:ExactlyOne>
<wsp:All>
<msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1" />
<wsaw:UsingAddressing />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
See dev.virtualearth.net.webservices.v1.search.wsdl for details.
Is there any way in configuration files to say: "use plain services and never use binary one"?