Object implementor = new TestMtomImpl();
String address = "http://localhost:9036/mime-test";
try {
Bus bus = BusFactoryHelper.newInstance().getDefaultBus();
JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(implementor.getClass());
AbstractServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(implInfo);
serviceFactory.setBus(bus);
Service service = serviceFactory.create();
QName endpointName = implInfo.getEndpointName();
EndpointInfo ei = service.getServiceInfo().getEndpoint(endpointName);
service.setInvoker(new JAXWSMethodInvoker(implementor));
org.apache.cxf.endpoint.EndpointImpl endpoint = new JaxWsEndpointImpl(bus, service, ei);
SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding());