当前位置: 首页>>代码示例>>Java>>正文


Java JaxWsProxyFactoryBean.getClientFactoryBean方法代码示例

本文整理汇总了Java中org.apache.cxf.jaxws.JaxWsProxyFactoryBean.getClientFactoryBean方法的典型用法代码示例。如果您正苦于以下问题:Java JaxWsProxyFactoryBean.getClientFactoryBean方法的具体用法?Java JaxWsProxyFactoryBean.getClientFactoryBean怎么用?Java JaxWsProxyFactoryBean.getClientFactoryBean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cxf.jaxws.JaxWsProxyFactoryBean的用法示例。


在下文中一共展示了JaxWsProxyFactoryBean.getClientFactoryBean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testInvokingServiceFromCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(ADDRESS);
    clientBean.setServiceClass(MyOrderEndpoint.class);
    
    MyOrderEndpoint client = (MyOrderEndpoint) proxyFactory.create();
    
    Holder<String> strPart = new Holder<String>();
    strPart.value = "parts";
    Holder<String> strCustomer = new Holder<String>();
    strCustomer.value = "";

    String result = client.myOrder(strPart, 2, strCustomer);
    assertEquals("Get a wrong order result", "Ordered ammount 2", result);
    assertEquals("Get a wrong parts", "parts", strPart.value);
    assertEquals("Get a wrong customer", "newCustomer", strCustomer.value);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:CxfHolderConsumerTest.java

示例2: testWSAddressing

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testWSAddressing() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new  JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(getClientAddress());
    clientBean.setServiceClass(Greeter.class);
    SpringBusFactory bf = new SpringBusFactory();
    URL cxfConfig = null;

    if (getCxfClientConfig() != null) {
        cxfConfig = ClassLoaderUtils.getResource(getCxfClientConfig(), this.getClass());
    }
    proxyFactory.setBus(bf.createBus(cxfConfig));
    Greeter client = (Greeter) proxyFactory.create();
    String result = client.greetMe("world!");
    assertEquals("Get a wrong response", "Hello world!", result);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:WSAddressingTest.java

示例3: testWSAddressing

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testWSAddressing() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new  JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(getClientAddress());
    clientBean.setServiceClass(HelloWorld.class);
    clientBean.setWsdlURL(WSRMTest.class.getResource("/HelloWorld.wsdl").toString());
    SpringBusFactory bf = new SpringBusFactory();
    URL cxfConfig = null;

    if (getCxfClientConfig() != null) {
        cxfConfig = ClassLoaderUtils.getResource(getCxfClientConfig(), this.getClass());
    }
    proxyFactory.setBus(bf.createBus(cxfConfig));
    proxyFactory.getOutInterceptors().add(new MessageLossSimulator());
    HelloWorld client = (HelloWorld) proxyFactory.create();
    String result = client.sayHi("world!");
    assertEquals("Get a wrong response", "Hello world!", result);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:WSRMTest.java

示例4: testInvokingServiceFromCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(ROUTER_ADDRESS);
    clientBean.setServiceClass(Greeter.class);

    Greeter client = (Greeter) proxyFactory.create();

    try {
        client.pingMe();
        fail("Expect to get an exception here");
    } catch (PingMeFault expected) {
        assertEquals(MESSAGE, expected.getMessage());
    } catch (Throwable t) {
        t.printStackTrace();
        fail("The CXF client did not manage to map the client exception "
            + t.getClass().getName() + " to a " + PingMeFault.class.getName()
            + ": " + t.getMessage());
    }

}
 
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:JaxWsWebFaultAnnotationToFaultTest.java

示例5: getProxy

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
private CreditAgencyWS getProxy() {
    // Here we use JaxWs front end to create the proxy
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(creditAgencyAddress);
    clientBean.setServiceClass(CreditAgencyWS.class);
    clientBean.setBus(BusFactory.getDefaultBus());
    return (CreditAgencyWS)proxyFactory.create();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:10,代码来源:CreditScoreProcessor.java

示例6: testInvokingServiceWithSoapHeaderFromCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testInvokingServiceWithSoapHeaderFromCXFClient() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(ADDRESS);
    clientBean.setServiceClass(MyOrderEndpoint.class);
    
    MyOrderEndpoint client = (MyOrderEndpoint) proxyFactory.create();
    
    Holder<String> header = new Holder<String>();
    header.value = "parts";

    String result = client.mySecureOrder(1, header);
    assertEquals("Get a wrong order result", "Ordered ammount 1", result);
    assertEquals("Get a wrong parts", "secureParts", header.value);
    
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:CxfHolderConsumerTest.java


注:本文中的org.apache.cxf.jaxws.JaxWsProxyFactoryBean.getClientFactoryBean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。