cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Dug myself into a pit switching from Simple to JAX-WS
Date Mon, 11 Oct 2010 12:20:00 GMT
This would normally belong on user but it's a sort of followup to the
Simple conversation...

I switched my MTOM-ish service to JAX-WS, and now my MTOM items
disappear. My unit tests all fail with null pointers since the data
handlers have nothing in them. It all worked fine with Simple (and
using properties to enable MTOM)....

So, I made the service side look like:

SEI:

@WebService
public interface DocumentDatabase { ... }

Implementation class:

@WebService(endpointInterface = "com.basistech.jdd.DocumentDatabase")
@MTOM
@BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
public class ...

Service factory:

 JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setDataBinding(new AegisDatabinding());
        svrFactory.setServiceClass(DocumentDatabase.class);
        svrFactory.setAddress("http://localhost:" +
documentServicePort + "/documentDatabase");
        svrFactory.setServiceBean(impl);
        server = svrFactory.create();


Client factory:

JaxWsClientFactoryBean clientFactory = new JaxWsClientFactoryBean();
        clientFactory.setBindingId(SOAPBinding.SOAP11HTTP_MTOM_BINDING);
        JaxWsProxyFactoryBean factory = new
JaxWsProxyFactoryBean(clientFactory);
        factory.setDataBinding(new AegisDatabinding());
        // perhaps not needed given the endpointInterface annotation
        factory.setServiceClass(DocumentDatabase.class);
        factory.setAddress(serviceUrl);
        return (DocumentDatabase) factory.create();

Mime
View raw message