本文整理汇总了Java中org.apache.cxf.bus.spring.SpringBusFactory类的典型用法代码示例。如果您正苦于以下问题:Java SpringBusFactory类的具体用法?Java SpringBusFactory怎么用?Java SpringBusFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpringBusFactory类属于org.apache.cxf.bus.spring包,在下文中一共展示了SpringBusFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
template = context.createProducerTemplate();
JaxWsServerFactoryBean svrBean = new JaxWsServerFactoryBean();
svrBean.setAddress(getServerAddress());
svrBean.setServiceClass(Greeter.class);
svrBean.setServiceBean(new GreeterImpl());
SpringBusFactory bf = new SpringBusFactory();
URL cxfConfig = null;
if (getCxfServerConfig() != null) {
cxfConfig = ClassLoaderUtils.getResource(getCxfServerConfig(), this.getClass());
}
svrBean.setBus(bf.createBus(cxfConfig));
serviceEndpoint = svrBean.create();
}
示例2: testWSAddressing
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的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: testSignature
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Test
public void testSignature() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterSignaturePort();
((BindingProvider)greeter).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + CXFTestSupport.getPort2()
+ "/WSSecurityRouteTest/GreeterSignaturePort"
);
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
示例4: testUsernameToken
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Test
public void testUsernameToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterUsernameTokenPort();
((BindingProvider)greeter).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + CXFTestSupport.getPort2()
+ "/WSSecurityRouteTest/GreeterUsernameTokenPort"
);
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
示例5: testEncryption
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Test
public void testEncryption() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterEncryptionPort();
((BindingProvider)greeter).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + CXFTestSupport.getPort2()
+ "/WSSecurityRouteTest/GreeterEncryptionPort"
);
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
示例6: testSecurityPolicy
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Test
public void testSecurityPolicy() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = WSSecurityRouteTest.class.getResource("../client/wssec.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
GreeterService gs = new GreeterService();
Greeter greeter = gs.getGreeterSecurityPolicyPort();
((BindingProvider)greeter).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + CXFTestSupport.getPort2()
+ "/WSSecurityRouteTest/GreeterSecurityPolicyPort"
);
assertEquals("Get a wrong response", "Hello Security", greeter.greetMe("Security"));
}
示例7: testWSAddressing
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的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);
}
示例8: testCamelDestinationConfiguration
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Test
public void testCamelDestinationConfiguration() throws Exception {
QName testEndpointQName = new QName("http://camel.apache.org/camel-test", "port");
// set up the bus with configure file
SpringBusFactory bf = new SpringBusFactory();
BusFactory.setDefaultBus(null);
Bus bus = bf.createBus("/org/apache/camel/component/cxf/transport/CamelDestination.xml");
BusFactory.setDefaultBus(bus);
endpointInfo.setAddress("camel://direct:EndpointA");
endpointInfo.setName(testEndpointQName);
CamelDestination destination = new CamelDestination(null, bus, null, endpointInfo);
assertEquals("{http://camel.apache.org/camel-test}port.camel-destination", destination.getBeanName());
CamelContext context = destination.getCamelContext();
assertNotNull("The camel context which get from camel destination is not null", context);
assertEquals("Get the wrong camel context", context.getName(), "dest_context");
assertEquals("The camel context should has two routers", context.getRoutes().size(), 2);
bus.shutdown(false);
}
示例9: createSoapClient
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public static DelegatedCredentialPortType createSoapClient(
String url, KeyStoreType truststore, KeyManagersType keyManager)
throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
SSLConfigurer sslConf = new SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKeystore(keyManager);
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(DelegatedCredentialService.class);
cf.setBus(bus);
DelegatedCredentialPortType cdsPort = cf.create(DelegatedCredentialPortType.class);
return cdsPort;
}
示例10: createSoapClient
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public static CredentialDelegationServicePortType createSoapClient(
String url, KeyStoreType truststore, KeyManagersType keyManager)
throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
SSLConfigurer sslConf = new SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKeystore(keyManager);
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(CredentialDelegationService.class);
cf.setBus(bus);
CredentialDelegationServicePortType cdsPort = cf.create(CredentialDelegationServicePortType.class);
return cdsPort;
}
示例11: createSoapClient
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public static GlobalModelExchangePortType createSoapClient(String url, KeyStoreType truststore, KeyManagersType keyManager) throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
org.cagrid.core.common.security.SSLConfigurer sslConf = new org.cagrid.core.common.security.SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKeystore(keyManager);
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(GlobalModelExchangeService.class);
cf.setBus(bus);
GlobalModelExchangePortType gmePort = cf.create(GlobalModelExchangePortType.class);
return gmePort;
}
示例12: createSoapClient
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public static GridGrouperPortType createSoapClient(String url,
KeyStoreType truststore, KeyManagersType keyManager)
throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
org.cagrid.core.common.security.SSLConfigurer sslConf = new org.cagrid.core.common.security.SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKeystore(keyManager);
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(GridGrouperService.class);
cf.setBus(bus);
GridGrouperPortType gridGrouperPort = cf.create(GridGrouperPortType.class);
return gridGrouperPort;
}
示例13: createSoapClient
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public static GTSPortType createSoapClient(String url,
KeyStoreType truststore, KeyManagersType keyManager)
throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
SSLConfigurer sslConf = new SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKeystore(keyManager);
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(GTSService.class);
cf.setBus(bus);
GTSPortType gtsPort = cf.create(GTSPortType.class);
return gtsPort;
}
示例14: createSoapClient
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public static DorianPortType createSoapClient(String url,
KeyStoreType truststore, KeyManagersType keyManager)
throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
SSLConfigurer sslConf = new SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKeystore(keyManager);
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(DorianService.class);
cf.setBus(bus);
DorianPortType dorianPort = cf.create(DorianPortType.class);
return dorianPort;
}
示例15: initService
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
/**
* Initialiseert een {@link ServiceImpl}.
* @return een {@link ServiceImpl} instantie
*/
ServiceImpl initService() {
final Bus bus = new SpringBusFactory().createBus();
URL url = getClass().getResource(WSDL_BESTAND);
if (url == null) {
throw new IllegalStateException(String.format("Wsdl bestand is niet gevonden : %s", WSDL_BESTAND));
}
return new ServiceImpl(bus, url, SERVICE_NAME, null);
}