serverFactoryBean.setInvoker(new CustomInvoker(getBimServer().getServiceFactory(), clazz)); if (getBimServer().getConfig().getEnvironment() != Environment.WAR) { serverFactoryBean.setAddress((bindingId == WSDLConstants.NS_SOAP11 ? "/soap11/" : "/soap12/") + clazz.getSimpleName()); // equals check allowed, just keep using the constant } else { serverFactoryBean.setAddress("/" + clazz.getSimpleName()); // equals check allowed, just keep using the constant
serverFactory.setAddress(addr); serverFactory.setStart(false); serverFactory.setEndpointName(endpointName);
@Override public void afterPropertiesSet() throws Exception { if (this.address == null) { throw new IllegalStateException("Address not initialized"); } if (this.service == null) { throw new IllegalStateException("Service not initialized"); } JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setAddress(this.address); factory.setServiceBean(this.service); this.server = factory.create(); this.server.start(); }
/** * Publish the JAX-WS endpoint. * @param publishUrl The url to publish the endpoint to */ public void publish(String publishUrl) { _publishUrl = publishUrl; SOAPLogger.ROOT_LOGGER.publishingWebServiceAt(_publishUrl); _svrFactory.setAddress(publishUrl); _server = _svrFactory.create(); _server.start(); }
/** * Publish the JAX-WS endpoint. * @param publishUrl The url to publish the endpoint to */ public void publish(String publishUrl) { _publishUrl = publishUrl; SOAPLogger.ROOT_LOGGER.publishingWebServiceAt(_publishUrl); _svrFactory.setAddress(publishUrl); _server = _svrFactory.create(); _server.start(); }
private Object obj; // JAX-WS resource singleton @Override public void loadBus(ServletConfig conf) { super.loadBus(conf); JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setBus(getBus()); factory.setAddress("/some/path"); factory.setServiceBean(obj); Server cxfServer = factory.create(); }
public void startService() { PersonServiceImpl personServiceImpl = new PersonServiceImpl(); JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setAddress("http://localhost:8282/person"); factory.setServiceClass(PersonService.class); factory.setServiceBean(personServiceImpl); Server server = factory.create(); server.start(); }
protected void run() { Object implementor = new GreeterImpl12(); String address = "http://localhost:" + PORT + "/SoapContext/SoapPort"; // enable the options of stack trace and the exception cause message Map<String, Object> properties = new HashMap<>(); properties.put("exceptionMessageCauseEnabled", "true"); properties.put("faultStackTraceEnabled", "true"); JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setAddress(address); factory.setServiceBean(implementor); factory.setProperties(properties); factory.create(); }
protected void run() { Object implementor = new GreeterImpl11(); String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort"; // enable the options of stack trace and the exception cause message Map<String, Object> properties = new HashMap<>(); properties.put("exceptionMessageCauseEnabled", "true"); properties.put("faultStackTraceEnabled", "true"); JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setAddress(address); factory.setServiceBean(implementor); factory.setProperties(properties); factory.create(); }
@PostConstruct public void init(){ JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); svrFactory.setServiceClass(MyWebService.class); svrFactory.setAddress("http://address.com"); svrFactory.setServiceBean(wsHandler); svrFactory.getInInterceptors().add(new LoggingInInterceptor()); svrFactory.getOutInterceptors().add(new LoggingOutInterceptor()); svrFactory.create();
ProviderImpl implementor = new ProviderImpl(); JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); svrFactory.setAddress("http://localhost:9000/providerexample"); svrFactory.setServiceBean(implementor); svrFactory.getInInterceptors().add(new LoggingInInterceptor()); svrFactory.getOutInterceptors().add(new LoggingOutInterceptor()); svrFactory.create();
private void registerService(final Class<?> service, final Object serviceImpl) { final JaxWsServerFactoryBean builder = new JaxWsServerFactoryBean(); builder.setBus(getBus()); builder.setAddress("http://localhost:" + PORT + "/" + service.getSimpleName()); builder.setServiceBean(serviceImpl); builder.setServiceClass(service); builder.create(); }
private static void initServer() { JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); factory.setServiceClass(AttachmentServiceImpl.class); factory.setAddress(ADDRESS); factory.setServiceBean(new AttachmentServiceImpl()); server = factory.create(); }
protected void run() { String address0 = "http://localhost:" + PORT0 + "/SoapExtHeader/SampleService"; Object implementor1 = new SamplePortTypeImpl(); Endpoint.publish(address0, implementor1); String address1 = "http://localhost:" + PORT1 + "/SoapExtHeader/SampleService"; JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(SamplePortTypeImpl.class); WebServiceClient webService = SampleService.class.getAnnotation(WebServiceClient.class); sf.setServiceName(new QName(webService.targetNamespace(), webService.name())); sf.setWsdlLocation(webService.wsdlLocation()); sf.setAddress(address1); extserver = sf.create(); }
private Server startServer() { final JaxWsServerFactoryBean srvFactory = new JaxWsServerFactoryBean(); srvFactory.setServiceClass(IBookstore.class); srvFactory.setAddress(TestCXFClientServerInterceptors.SERVICE_ADDRESS); srvFactory.setServiceBean(new BookstoreImpl()); // On the server-side, we only intercept incoming requests and outgoing responses. srvFactory.getInInterceptors().add(new OperationExecutionSOAPRequestInInterceptor(this.serverMonitoringController)); srvFactory.getOutInterceptors().add(new OperationExecutionSOAPResponseOutInterceptor(this.serverMonitoringController)); return srvFactory.create(); }
protected void run() { final Tracing brave = Tracing.newBuilder() .localServiceName("book-store") .spanReporter(new TestSpanReporter()) .build(); final JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(BookStore.class); sf.setAddress("http://localhost:" + PORT); sf.getFeatures().add(new BraveFeature(brave)); sf.create(); } }
@BeforeClass public static void startServer() { startBusAndJMS(JavaFirstNoWsdlTest.class); JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); svrFactory.setBus(bus); svrFactory.getFeatures().add(cff); svrFactory.setServiceClass(Hello.class); svrFactory.setAddress(SERVICE_ADDRESS); svrFactory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID); svrFactory.setServiceBean(new HelloImpl()); svrFactory.create(); }
protected void run() { SpringBusFactory bf = new SpringBusFactory(); Bus bus = bf.createBus("org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/server.xml"); setBus(bus); JaxWsServerFactoryBean serviceFactory = new JaxWsServerFactoryBean(); serviceFactory.setBus(bus); serviceFactory.setServiceClass(MessageProviderWithAddressingPolicy.class); serviceFactory.setWsdlLocation("wsdl_systest_wsspec/addr-jaxwsmm.wsdl"); serviceFactory.setAddress(ADDRESS); org.apache.cxf.endpoint.Server provider = serviceFactory.create(); EndpointInfo ei = provider.getEndpoint().getEndpointInfo(); LOG.info("Started server at: " + ei.getAddress()); testInterceptors(bus); }
@Test public void testServerFactory() { JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.getFeatures().add(new WSAddressingFeature()); sf.setServiceBean(new GreeterImpl()); sf.setAddress("http://localhost:" + PORT + "/test"); sf.setStart(false); sf.setBus(getBus()); Server server = sf.create(); Endpoint endpoint = server.getEndpoint(); checkAddressInterceptors(endpoint.getInInterceptors()); }
@Test public void testServerFactory() { JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); assertNotNull(bus != null); sf.setServiceBean(new GreeterImpl()); sf.setAddress("http://localhost:" + PORT + "/test"); sf.setStart(false); Configurer c = getBus().getExtension(Configurer.class); c.configureBean("server", sf); Server server = sf.create(); Endpoint endpoint = server.getEndpoint(); checkAddressInterceptors(endpoint.getInInterceptors()); }