Java Code Examples for org.apache.cxf.service.Service#setInvoker()

The following examples show how to use org.apache.cxf.service.Service#setInvoker() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExceptionTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test(expected = HelloException.class)
public void testJaxwsServerSimpleClient() throws Exception {
    JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
    sfbean.setServiceClass(ExceptionService.class);
    sfbean.setDataBinding(new AegisDatabinding());
    sfbean.setAddress("local://ExceptionServiceJaxWs1");
    Server server = sfbean.create();
    Service service = server.getEndpoint().getService();
    service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

    ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
    proxyFac.setAddress("local://ExceptionServiceJaxWs1");
    proxyFac.setBus(getBus());
    setupAegis(proxyFac.getClientFactoryBean());

    ExceptionService clientInterface = proxyFac.create(ExceptionService.class);

    clientInterface.sayHiWithException();
}
 
Example 2
Source File: ExceptionTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test(expected = HelloException.class)
public void testJaxwsNoXfireCompat() throws Exception {
    JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
    sfbean.setServiceClass(ExceptionService.class);
    sfbean.setDataBinding(new AegisDatabinding());
    sfbean.getServiceFactory().setDataBinding(sfbean.getDataBinding());
    sfbean.setAddress("local://ExceptionServiceJaxWs");
    Server server = sfbean.create();
    Service service = server.getEndpoint().getService();
    service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

    JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
    proxyFac.setAddress("local://ExceptionServiceJaxWs");
    proxyFac.setServiceClass(ExceptionService.class);
    proxyFac.setBus(getBus());
    proxyFac.getClientFactoryBean().getServiceFactory().setDataBinding(new AegisDatabinding());
    ExceptionService clientInterface = (ExceptionService)proxyFac.create();

    clientInterface.sayHiWithException();
}
 
Example 3
Source File: ExceptionTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test(expected = HelloException.class)
public void testJaxws() throws Exception {
    JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
    sfbean.setServiceClass(ExceptionService.class);
    setupAegis(sfbean);
    sfbean.setAddress("local://ExceptionService4");
    Server server = sfbean.create();
    Service service = server.getEndpoint().getService();
    service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

    JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
    proxyFac.setAddress("local://ExceptionService4");
    proxyFac.setBus(getBus());
    setupAegis(proxyFac.getClientFactoryBean());
    ExceptionService clientInterface = proxyFac.create(ExceptionService.class);

    clientInterface.sayHiWithException();
}
 
Example 4
Source File: InterfaceInheritanceTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
    super.setUp();
    Server server = createService(IInterfaceService.class);
    Service service = server.getEndpoint().getService();
    service.setInvoker(new BeanInvoker(new InterfaceService()));
}
 
Example 5
Source File: MissingTypeWSDLTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testMissingTransliteration() throws Exception {
    Server server = createService(MissingType.class, new MissingTypeImpl(), null);
    Service service = server.getEndpoint().getService();
    service.setInvoker(new BeanInvoker(new MissingTypeImpl()));
    ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
    proxyFac.setAddress("local://MissingType");
    proxyFac.setBus(getBus());
    setupAegis(proxyFac.getClientFactoryBean());

    Document wsdl = getWSDLDocument("MissingType");
    assertValid("/wsdl:definitions/wsdl:types"
                + "/xsd:schema[@targetNamespace='urn:org:apache:cxf:aegis:type:missing']"
                + "/xsd:complexType[@name=\"Inner\"]", wsdl);
}