Search in sources :

Example 56 with EndpointImpl

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

the class Server method run.

protected void run() {
    setBus(BusFactory.getDefaultBus());
    getBus().getInInterceptors().add(new LoggingInInterceptor());
    String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
    Object implementor1 = new GreeterImplMixedStyle(" version1");
    EndpointImpl ep1 = (EndpointImpl) Endpoint.publish(address, implementor1);
    ep1.getServer().getEndpoint().put("version", "1");
    ep1.getServer().getEndpoint().put("allow-multiplex-endpoint", Boolean.TRUE);
    // Register a MediatorInInterceptor on this dummy service
    Object implementor2 = new GreeterImplMixedStyle(" version2");
    EndpointImpl ep2 = (EndpointImpl) Endpoint.publish(address, implementor2);
    ep2.getServer().getEndpoint().put("version", "2");
    MultipleEndpointObserver meo = (MultipleEndpointObserver) ep1.getServer().getDestination().getMessageObserver();
    meo.getRoutingInterceptors().clear();
    meo.getRoutingInterceptors().add(new MediatorInInterceptor());
}
Also used : MultipleEndpointObserver(org.apache.cxf.transport.MultipleEndpointObserver) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor) GreeterImplMixedStyle(org.apache.hello_world_mixedstyle.GreeterImplMixedStyle)

Example 57 with EndpointImpl

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

the class Server method run.

protected void run() {
    setBus(BusFactory.getDefaultBus());
    Object implementor = new AddNumberImpl();
    String address = "http://localhost:" + PORT + "/AddNumberImplPort";
    ep1 = new EndpointImpl(implementor);
    ep1.getFeatures().add(new WSAddressingFeature());
    ep1.publish(address);
    ep2 = new EndpointImpl(new AddNumberImplNoAddr());
    ep2.publish(address + "-noaddr");
}
Also used : WSAddressingFeature(org.apache.cxf.ws.addressing.WSAddressingFeature) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 58 with EndpointImpl

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

the class Server method run.

protected void run() {
    Object implementor = new AddNumberReg();
    String address = "http://localhost:" + PORT + "/jaxws/add";
    EndpointImpl ep;
    ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
    ep.getFeatures().add(new WSAddressingFeature());
    ep.publish(address);
    eps.add(ep);
    implementor = new AddNumberNonAnon();
    address = "http://localhost:" + PORT + "/jaxws/addNonAnon";
    ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
    ep.getFeatures().add(new WSAddressingFeature());
    ep.publish(address);
    eps.add(ep);
    implementor = new AddNumberOnlyAnon();
    address = "http://localhost:" + PORT + "/jaxws/addAnon";
    ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
    ep.getFeatures().add(new WSAddressingFeature());
    ep.publish(address);
    eps.add(ep);
}
Also used : WSAddressingFeature(org.apache.cxf.ws.addressing.WSAddressingFeature) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 59 with EndpointImpl

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

the class WebServiceListener method open.

@Override
public void open() throws ListenerException {
    if (StringUtils.isNotEmpty(getAddress())) {
        log.debug("registering listener [" + getName() + "] with JAX-WS CXF Dispatcher on SpringBus [" + cxfBus.getId() + "]");
        endpoint = new EndpointImpl(cxfBus, new MessageProvider(this, getMultipartXmlSessionKey()));
        // TODO: prepend with `local://` when used without application server
        endpoint.publish("/" + getAddress());
        SOAPBinding binding = (SOAPBinding) endpoint.getBinding();
        binding.setMTOMEnabled(isMtomEnabled());
        if (endpoint.isPublished()) {
            log.debug("published listener [" + getName() + "] on CXF endpoint [" + getAddress() + "]");
        } else {
            log.error("unable to publish listener [" + getName() + "] on CXF endpoint [" + getAddress() + "]");
        }
    }
    // Can bind on multiple endpoints
    if (StringUtils.isNotEmpty(getServiceNamespaceURI())) {
        log.debug("registering listener [" + getName() + "] with ServiceDispatcher by serviceNamespaceURI [" + getServiceNamespaceURI() + "]");
        ServiceDispatcher.getInstance().registerServiceClient(getServiceNamespaceURI(), this);
    } else {
        log.debug("registering listener [" + getName() + "] with ServiceDispatcher");
        // Backwards compatibility
        ServiceDispatcher.getInstance().registerServiceClient(getName(), this);
    }
    super.open();
}
Also used : MessageProvider(nl.nn.adapterframework.http.cxf.MessageProvider) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) SOAPBinding(javax.xml.ws.soap.SOAPBinding)

Example 60 with EndpointImpl

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

the class ServiceConfiguration method endpoint.

@Bean
public Endpoint endpoint() {
    EndpointImpl endpoint = new EndpointImpl(springBus(), new BaeldungImpl());
    endpoint.publish("http://localhost:8081/services/baeldung");
    return endpoint;
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) Bean(org.springframework.context.annotation.Bean)

Aggregations

EndpointImpl (org.apache.cxf.jaxws.EndpointImpl)66 QName (javax.xml.namespace.QName)14 Bean (org.springframework.context.annotation.Bean)10 Bus (org.apache.cxf.Bus)9 Test (org.junit.Test)9 BeforeClass (org.junit.BeforeClass)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 SOAPBinding (javax.xml.ws.soap.SOAPBinding)3 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