Search in sources :

Example 91 with JaxWsProxyFactoryBean

use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project camel by apache.

the class PayLoadConvertToPOJOTest method testClient.

@Test
public void testClient() throws Exception {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setAddress("http://localhost:" + getPort1() + "/" + getClass().getSimpleName() + "/CamelContext/RouterPort");
    factory.setServiceClass(Person.class);
    Person person = factory.create(Person.class);
    GetPerson payload = new GetPerson();
    payload.setPersonId("1234");
    GetPersonResponse reply = person.getPerson(payload);
    assertEquals("Get the wrong person id.", "1234", reply.getPersonId());
}
Also used : GetPersonResponse(org.apache.camel.non_wrapper.types.GetPersonResponse) GetPerson(org.apache.camel.non_wrapper.types.GetPerson) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) GetPerson(org.apache.camel.non_wrapper.types.GetPerson) Person(org.apache.camel.non_wrapper.Person) Test(org.junit.Test)

Example 92 with JaxWsProxyFactoryBean

use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project fabric8 by jboss-fuse.

the class LoadBalanceClientServerTest method testClientServer.

@Test
public void testClientServer() throws Exception {
    assertNotNull(bus);
    // The bus is load the feature
    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    factory.setServiceBean(new HelloImpl());
    factory.setAddress("http://localhost:9000/simple/server");
    factory.setBus(bus);
    factory.create();
    // sleep a while to let the service be published
    for (int i = 0; i < 100; i++) {
        if (!feature.getLoadBalanceStrategy().getAlternateAddressList().isEmpty()) {
            break;
        }
        Thread.sleep(100);
    }
    JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
    clientFactory.setServiceClass(Hello.class);
    // The address is not the actual address that the client will access
    clientFactory.setAddress("http://someotherplace");
    List<AbstractFeature> features = new ArrayList<AbstractFeature>();
    features.add(feature);
    // we need to setup the feature on the clientfactory
    clientFactory.setFeatures(features);
    Hello hello = clientFactory.create(Hello.class);
    String response = hello.sayHello();
    assertEquals("Get a wrong response", "Hello", response);
    response = hello.sayHello();
    assertEquals("Get a wrong response", "Hello", response);
    // Try to call the hello proxy which is created by Spring with setting feature on the bus
    response = helloProxy.sayHello();
    assertEquals("Get a wrong response", "Hello", response);
}
Also used : JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) ArrayList(java.util.ArrayList) AbstractFeature(org.apache.cxf.feature.AbstractFeature) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) Test(org.junit.Test)

Example 93 with JaxWsProxyFactoryBean

use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project steve by RWTH-i5-IDSG.

the class ChargePointService12_InvokerImpl method create.

private static ChargePointService create(ChargePointSelect cp) {
    JaxWsProxyFactoryBean f = ClientProvider.getBean(cp.getEndpointAddress());
    f.setServiceClass(ChargePointService.class);
    return (ChargePointService) f.create();
}
Also used : JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) ChargePointService(ocpp.cp._2010._08.ChargePointService)

Example 94 with JaxWsProxyFactoryBean

use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project steve by RWTH-i5-IDSG.

the class ChargePointService16_InvokerImpl method create.

private static ChargePointService create(ChargePointSelect cp) {
    JaxWsProxyFactoryBean f = ClientProvider.getBean(cp.getEndpointAddress());
    f.setServiceClass(ChargePointService.class);
    return (ChargePointService) f.create();
}
Also used : JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) ChargePointService(ocpp.cp._2015._10.ChargePointService)

Example 95 with JaxWsProxyFactoryBean

use of org.apache.cxf.jaxws.JaxWsProxyFactoryBean in project steve by RWTH-i5-IDSG.

the class ApplicationTest method getForOcpp15.

private static ocpp.cs._2012._06.CentralSystemService getForOcpp15() {
    JaxWsProxyFactoryBean f = getBean(path);
    f.setServiceClass(ocpp.cs._2012._06.CentralSystemService.class);
    return (ocpp.cs._2012._06.CentralSystemService) f.create();
}
Also used : CentralSystemService(ocpp.cs._2012._06.CentralSystemService) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean)

Aggregations

JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)152 Test (org.junit.Test)71 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)21 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)19 AegisDatabinding (org.apache.cxf.aegis.databinding.AegisDatabinding)14 Greeter (org.apache.hello_world_soap_http.Greeter)14 Client (org.apache.cxf.endpoint.Client)13 HashMap (java.util.HashMap)10 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)9 QName (javax.xml.namespace.QName)8 WrappedGreeter (org.apache.hello_world_soap_action.WrappedGreeter)8 BookStoreService (org.apache.cxf.systest.jaxws.tracing.BookStoreService)7 ArrayList (java.util.ArrayList)6 ClientFactoryBean (org.apache.cxf.frontend.ClientFactoryBean)6 Holder (javax.xml.ws.Holder)5 Server (org.apache.cxf.endpoint.Server)5 Greeter (org.apache.cxf.greeter_control.Greeter)5 Service (org.apache.cxf.service.Service)5 HTTPConduit (org.apache.cxf.transport.http.HTTPConduit)5 Metadata (org.apache.cxf.ws.mex.model._2004_09.Metadata)5