public Endpoint createEndpoint(String bindingId, Class<?> implementorClass, Invoker invoker, WebServiceFeature ... features) { if (EndpointUtils.isValidImplementor(implementorClass)) { Bus bus = BusFactory.getThreadDefaultBus(); JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); if (features != null) { factory.getJaxWsServiceFactory().setWsFeatures(Arrays.asList(features)); } if (invoker != null) { factory.setInvoker(new JAXWSMethodInvoker(invoker)); try { invoker.inject(new WebServiceContextImpl()); } catch (Exception e) { throw new WebServiceException(new Message("ENDPOINT_CREATION_FAILED_MSG", LOG).toString(), e); } } EndpointImpl ep = new EndpointImpl(bus, null, factory); ep.setImplementorClass(implementorClass); return ep; } throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString()); }
private Server createServerFromJaxwsEndpoint(JaxWsServerFactoryBean factory) { @SuppressWarnings("resource") EndpointImpl endpoint = new EndpointImpl(factory.getBus(), null, factory); endpoint.setWsdlLocation(factory.getWsdlURL()); endpoint.setImplementorClass(factory.getServiceClass()); endpoint.setEndpointName(factory.getEndpointName()); endpoint.setServiceName(factory.getServiceName()); endpoint.setInvoker(factory.getInvoker()); endpoint.setSchemaLocations(factory.getSchemaLocations()); return endpoint.getServer(factory.getAddress()); }
public Endpoint createEndpoint(String bindingId, Class<?> implementorClass, Invoker invoker, WebServiceFeature ... features) { if (EndpointUtils.isValidImplementor(implementorClass)) { Bus bus = BusFactory.getThreadDefaultBus(); JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); if (features != null) { factory.getJaxWsServiceFactory().setWsFeatures(Arrays.asList(features)); } if (invoker != null) { factory.setInvoker(new JAXWSMethodInvoker(invoker)); try { invoker.inject(new WebServiceContextImpl()); } catch (Exception e) { throw new WebServiceException(new Message("ENDPOINT_CREATION_FAILED_MSG", LOG).toString(), e); } } EndpointImpl ep = new EndpointImpl(bus, null, factory); ep.setImplementorClass(implementorClass); return ep; } throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString()); }