The simplest may be to do :

((BindingProvider)proxy).getRequestContext()
  .put("mtom-enabled", Boolean.FALSE)

after the proxy is created.  That said, the setMTOMEnabled should also do 
it.   If that doesn't help, it MAY be detecting that something thinks soap 
w/ attachments should be used (slightly different than MTOM).  You thus may 
also need to do:

((BindingProvider)proxy).getRequestContext()
  .put("write.attachments", Boolean.FALSE)


Dan


On Wednesday, August 01, 2012 02:21:46 AM Asif Ali wrote:
> Hi,
> I have written a client code to consume a service. The wsdl contains a
> schema element of type base64encoder. CXF is sending the content of that
> element using MTOM attachment since it is binary data but the service
> provider is unable to retrieve the content through attachment due to
> framework limitations. I have tried to turn off the MTOM feature by adding
> MTOMFeature class instance to the JaxWSProxyFactoryBean but not able to
> because MTOMFeature class is not a subclass of AbstractFeature class.
> 
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> javax.xml.ws.soap.MTOMFeature mtom = new MTOMFeature(false);
> factory.getFeatures().add(mtom); // Compilation Error....
> factory.setServiceClass(ESignExternalListDocumentForSigner.class);
> factory.setAddress("https://127.0.0.1:29528/e-Sign/ListDocumentForSigner";)
> ; factory.create();
> 
> I cannot go for a change in the schema because the service provider also
> has to accept the change. I have also tried the below option which does
> not seem to be working.
> 
> SOAPBinding sbinding = (SOAPBinding)bp.getBinding();
> sbinding.setMTOMEnabled(false);
> 
> Please suggest how to resolve the compilation error.
> 
> Thanks in Advance,
> Asif Ali Mohammed.
> 
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Turn-off-MTOM-feature-in-the-client-code-
> to-avoid-xop-generation-tp5711807.html Sent from the cxf-dev mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to