Search in sources :

Example 6 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 HelloImpl();
    String address = "http://localhost:" + PORT + "/wsa/responses";
    ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
    ep.publish(address);
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 7 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 AddNumberImpl();
    String address = "http://localhost:" + PORT + "/jaxws/add";
    EndpointImpl ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
    ep.publish(address);
    eps.add(ep);
    eps.add(Endpoint.publish(address + "-provider", new AddNumberProvider()));
    eps.add(Endpoint.publish(address + "-providernows", new AddNumberProviderNoWsdl()));
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 8 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 + "/jaxws/addmex";
    ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
    ep.publish(address);
}
Also used : EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

Example 9 with EndpointImpl

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

the class SecurityPolicyTest method init.

@BeforeClass
public static void init() throws Exception {
    URL wsdl = SecurityPolicyTest.class.getResource("DoubleIt.wsdl");
    createStaticBus(SecurityPolicyTest.class.getResource("https_config.xml").toString()).getExtension(PolicyEngine.class).setEnabled(true);
    getStaticBus().getOutInterceptors().add(new LoggingOutInterceptor());
    EndpointImpl ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortHttps"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_HTTPS_ADDRESS);
    ep.publish();
    ep.getServer().getEndpoint().getEndpointInfo().setProperty(SecurityConstants.CALLBACK_HANDLER, new ServerPasswordCallback());
    Endpoint.publish(POLICY_ADDRESS, new DoubleItImpl());
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortEncryptThenSign"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_ENCSIGN_ADDRESS);
    ep.publish();
    EndpointInfo ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortSignThenEncrypt"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_SIGNENC_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortSign"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_SIGN_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortXPath"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_XPATH_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "alice.properties", "bob.properties");
    ep = (EndpointImpl) Endpoint.publish(POLICY_SIGNENC_PROVIDER_ADDRESS, new DoubleItProvider());
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.publish(POLICY_FAULT_SIGNENC_PROVIDER_ADDRESS, new DoubleItFaultProvider());
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortSignedOnly"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_SIGNONLY_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortCXF3041"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_CXF3041_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortCXF3042"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_CXF3042_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "alice.properties", "alice.properties");
    ep = (EndpointImpl) Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortCXF3452"));
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_CXF3452_ADDRESS);
    ep.publish();
    ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "alice.properties", "alice.properties");
    ei.setProperty(Message.SCHEMA_VALIDATION_ENABLED, Boolean.TRUE);
}
Also used : EndpointInfo(org.apache.cxf.service.model.EndpointInfo) DoubleItImpl(org.apache.cxf.systest.ws.common.DoubleItImpl) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl) PolicyEngine(org.apache.cxf.ws.policy.PolicyEngine) URL(java.net.URL) BeforeClass(org.junit.BeforeClass)

Example 10 with EndpointImpl

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

the class ProviderImpl method createEndpoint.

// new in 2.2
public Endpoint createEndpoint(String bindingId, Object implementor, WebServiceFeature... features) {
    EndpointImpl ep = null;
    if (EndpointUtils.isValidImplementor(implementor)) {
        Bus bus = BusFactory.getThreadDefaultBus();
        ep = createEndpointImpl(bus, bindingId, implementor, features);
        return ep;
    }
    throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}
Also used : Bus(org.apache.cxf.Bus) WebServiceException(javax.xml.ws.WebServiceException) Message(org.apache.cxf.common.i18n.Message) EndpointImpl(org.apache.cxf.jaxws.EndpointImpl)

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