Factory factory = new PerRequestFactory(DocLitWrappedCodeFirstServiceImpl.class);
factory = new PooledFactory(factory, 4);
JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(factory);
JaxWsServerFactoryBean factoryBean;
factoryBean = new JaxWsServerFactoryBean();
factoryBean.setAddress(DOCLIT_CODEFIRST_URL);
factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class);
factoryBean.setInvoker(invoker);
servers.add(factoryBean.create());
factoryBean = new JaxWsServerFactoryBean();
factoryBean.setAddress(DOCLIT_CODEFIRST_SETTINGS_URL);
factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class);
factoryBean.setInvoker(invoker);
factoryBean.getServiceFactory().setAnonymousWrapperTypes(true);
factoryBean.getServiceFactory().getServiceConfigurations().add(0, new AbstractServiceConfiguration() {
public Boolean isWrapperPartNillable(MessagePartInfo mpi) {
return Boolean.TRUE;
}
public Long getWrapperPartMinOccurs(MessagePartInfo mpi) {
return Long.valueOf(1L);
}
});
servers.add(factoryBean.create());
//Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
//endpoints.add(Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4));
Object implementor7 = new DocLitBareCodeFirstServiceImpl();