Search in sources :

Example 21 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.

the class ServerMisc method run.

protected void run() {
    Factory factory = new PerRequestFactory(DocLitWrappedCodeFirstServiceImpl.class);
    factory = new PooledFactory(factory, 4);
    JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(factory);
    JaxWsServerFactoryBean factoryBean;
    Map<String, Object> properties = new HashMap<>();
    properties.put("bus.jmx.usePlatformMBeanServer", Boolean.TRUE);
    properties.put("bus.jmx.enabled", Boolean.TRUE);
    Bus b = new CXFBusFactory().createBus(null, properties);
    setBus(b);
    MetricRegistry registry = new MetricRegistry();
    CodahaleMetricsProvider.setupJMXReporter(b, registry);
    b.setExtension(registry, MetricRegistry.class);
    factoryBean = new JaxWsServerFactoryBean();
    factoryBean.setBus(b);
    factoryBean.setAddress(DOCLIT_CODEFIRST_URL);
    factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class);
    factoryBean.setFeatures(Arrays.asList(new MetricsFeature()));
    factoryBean.setInvoker(invoker);
    servers.add(factoryBean.create());
    factoryBean = new JaxWsServerFactoryBean();
    factoryBean.setBus(b);
    factoryBean.setAddress(DOCLIT_CODEFIRST_URL_XMLBINDING);
    factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class);
    factoryBean.setFeatures(Arrays.asList(new MetricsFeature()));
    factoryBean.setInvoker(invoker);
    factoryBean.setBindingId("http://cxf.apache.org/bindings/xformat");
    factoryBean.setWsdlURL("cxf6866.wsdl");
    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();
    EndpointImpl ep = (EndpointImpl) Endpoint.publish(DOCLITBARE_CODEFIRST_URL, implementor7);
    ep.getServer().getEndpoint().getInInterceptors().add(new SAAJInInterceptor());
    endpoints.add(ep);
    Object implementor6 = new InterfaceInheritTestImpl();
    endpoints.add(Endpoint.publish(DOCLIT_CODEFIRST_BASE_URL, implementor6));
    Object implementor1 = new AnonymousComplexTypeImpl();
    String address = "http://localhost:" + PORT + "/anonymous_complex_typeSOAP";
    endpoints.add(Endpoint.publish(address, implementor1));
    Object implementor2 = new JaxbElementTestImpl();
    address = "http://localhost:" + PORT + "/jaxb_element_test";
    endpoints.add(Endpoint.publish(address, implementor2));
    Object implementor3 = new OrderedParamHolderImpl();
    address = "http://localhost:" + PORT + "/ordered_param_holder/";
    endpoints.add(Endpoint.publish(address, implementor3));
    // Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
    // endpoints.add(Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4));
    Object implementor5 = new RpcLitCodeFirstServiceImpl();
    endpoints.add(Endpoint.publish(RPCLIT_CODEFIRST_URL, implementor5));
    endpoints.add(Endpoint.publish("http://localhost:" + PORT + "/InheritContext/InheritPort", new InheritImpl()));
    endpoints.add(Endpoint.publish(CXF_5064_URL, new SOAPHeaderServiceImpl()));
}
Also used : HashMap(java.util.HashMap) MetricsFeature(org.apache.cxf.metrics.MetricsFeature) Factory(org.apache.cxf.service.invoker.Factory) PooledFactory(org.apache.cxf.service.invoker.PooledFactory) PerRequestFactory(org.apache.cxf.service.invoker.PerRequestFactory) CXFBusFactory(org.apache.cxf.bus.CXFBusFactory) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) PooledFactory(org.apache.cxf.service.invoker.PooledFactory) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) CXFBusFactory(org.apache.cxf.bus.CXFBusFactory) JaxbElementTestImpl(org.apache.cxf.jaxb_element_test.JaxbElementTestImpl) Bus(org.apache.cxf.Bus) SOAPHeaderServiceImpl(org.apache.cxf.systest.jaxws.cxf5064.SOAPHeaderServiceImpl) MetricRegistry(com.codahale.metrics.MetricRegistry) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) JAXWSMethodInvoker(org.apache.cxf.jaxws.JAXWSMethodInvoker) SAAJInInterceptor(org.apache.cxf.binding.soap.saaj.SAAJInInterceptor) AbstractServiceConfiguration(org.apache.cxf.wsdl.service.factory.AbstractServiceConfiguration) AnonymousComplexTypeImpl(org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeImpl) OrderedParamHolderImpl(org.apache.cxf.ordered_param_holder.OrderedParamHolderImpl) PerRequestFactory(org.apache.cxf.service.invoker.PerRequestFactory)

Example 22 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.

the class Server method run.

protected void run() {
    String port = TestUtil.getPortNumber(Server.class);
    Object implementor = new SwAServiceImpl();
    String address = "http://localhost:" + port + "/swa";
    EndpointImpl ep;
    try {
        ep = (EndpointImpl) Endpoint.create(new SwANoMimeServiceImpl());
        ep.setWsdlLocation("classpath:wsdl/swa-mime-nomime.wsdl");
        ep.publish(address + "-nomime");
        ep = (EndpointImpl) Endpoint.create(implementor);
        ep.setWsdlLocation("classpath:wsdl/swa-mime.wsdl");
        ep.publish(address);
    } catch (Exception e) {
        e.printStackTrace();
        Thread.currentThread().interrupt();
    }
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 23 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.

the class JMSTestMtom method startServers.

@BeforeClass
public static void startServers() throws Exception {
    broker = new EmbeddedJMSBrokerLauncher();
    broker.startInProcess();
    bus = BusFactory.getDefaultBus();
    broker.updateWsdl(bus, "testutils/jms_test_mtom.wsdl");
    Object mtom = new JMSMTOMImpl();
    EndpointImpl ep = (EndpointImpl) Endpoint.publish("jms:jndi:dynamicQueues/test.cxf.jmstransport.queue&amp;receiveTimeout=10000", mtom);
    Binding binding = ep.getBinding();
    ((SOAPBinding) binding).setMTOMEnabled(true);
}
Also used : Binding(javax.xml.ws.Binding) SOAPBinding(javax.xml.ws.soap.SOAPBinding) EmbeddedJMSBrokerLauncher(org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) SOAPBinding(javax.xml.ws.soap.SOAPBinding) BeforeClass(org.junit.BeforeClass)

Example 24 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.

the class MultiTransportClientServerTest method startServers.

@BeforeClass
public static void startServers() throws Exception {
    bus = BusFactory.getDefaultBus();
    ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
    PooledConnectionFactory cfp = new PooledConnectionFactory(cf);
    cff = new ConnectionFactoryFeature(cfp);
    String address = "http://localhost:" + PORT + "/SOAPDocLitService/SoapPort";
    Endpoint.publish(address, new HTTPGreeterImpl());
    EndpointImpl ep1 = (EndpointImpl) Endpoint.create(new JMSGreeterImpl());
    ep1.setBus(bus);
    ep1.getFeatures().add(cff);
    ep1.publish();
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) HTTPGreeterImpl(org.apache.hello_world_doc_lit.HTTPGreeterImpl) ConnectionFactoryFeature(org.apache.cxf.transport.jms.ConnectionFactoryFeature) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) JMSGreeterImpl(org.apache.hello_world_doc_lit.JMSGreeterImpl) BeforeClass(org.junit.BeforeClass)

Example 25 with EndpointImpl

use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.

the class JMSTransactionTest method startServers.

@BeforeClass
public static void startServers() throws Exception {
    startBusAndJMS(JMSTransactionTest.class);
    // startBusAndJMS("tcp://localhost:61616");
    endpoint = new EndpointImpl(bus, new GreeterImplWithTransaction());
    endpoint.setAddress(SERVICE_ADDRESS);
    endpoint.setFeatures(Collections.singletonList(cff));
    endpoint.publish();
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) BeforeClass(org.junit.BeforeClass)

Aggregations

EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)61 QName (javax.xml.namespace.QName)14 Test (org.junit.Test)9 Bus (org.apache.cxf.Bus)8 BeforeClass (org.junit.BeforeClass)7 Bean (org.springframework.context.annotation.Bean)7 Endpoint (javax.xml.ws.Endpoint)5 URL (java.net.URL)4 HashMap (java.util.HashMap)4 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)4 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)4 Feature (org.apache.cxf.feature.Feature)4 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)4 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)3 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 JAXBException (javax.xml.bind.JAXBException)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 WebServiceException (javax.xml.ws.WebServiceException)2