本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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());
}
}
示例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();
}
示例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);
}