本文整理汇总了Java中org.apache.cxf.bus.spring.SpringBusFactory类的典型用法代码示例。如果您正苦于以下问题:Java SpringBusFactory类的具体用法?Java SpringBusFactory怎么用?Java SpringBusFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpringBusFactory类属于org.apache.cxf.bus.spring包,在下文中一共展示了SpringBusFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:WSAddressingTest.java
示例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);
}
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:WSAddressingTest.java
示例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"));
}
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java
示例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"));
}
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java
示例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"));
}
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java
示例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"));
}
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:WSSecurityRouteTest.java
示例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);
}
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:WSRMTest.java
示例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);
}
开发者ID:HydAu,项目名称:Camel,代码行数:22,代码来源:CamelDestinationTest.java
示例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;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:21,代码来源:DCSSoapClientFactory.java
示例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;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:CDSSoapClientFactory.java
示例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;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:17,代码来源:GMESoapClientFactory.java
示例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;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:GridGrouperSoapClientFactory.java
示例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;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:20,代码来源:GTSSoapClientFactory.java
示例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;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:DorianSoapClientFactory.java
示例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);
}
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:13,代码来源:AbstractWebServiceClient.java
示例16: givenFakeSOAPWebserviceThroughHttps
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Given("send SOAP web service through https")
public void givenFakeSOAPWebserviceThroughHttps() {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("src/test/resources/META-INF/spring/jaxws-server-with-ssl.xml");
BusFactory.setDefaultBus(bus);
Endpoint endpoint = Endpoint.publish("https://localhost:9091/WheatherServicePort", new WheatherServiceImpl());
assertTrue(endpoint.isPublished());
Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());
}
开发者ID:tapack,项目名称:satisfy,代码行数:10,代码来源:FakeSoapServiceSteps.java
示例17: getBean
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
static JAXRSClientFactoryBean getBean(String baseAddress, String configLocation, Map<String, String> headers) {
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
if (configLocation != null) {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus(configLocation);
bean.setBus(bus);
}
bean.setAddress(baseAddress);
if (headers != null && !headers.isEmpty()) {
bean.setHeaders(headers);
}
return bean;
}
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:14,代码来源:IdentityManagementEndpointUtil.java
示例18: cxf
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
public Bus cxf() {
SpringBusFactory factory = new SpringBusFactory();
springBus = factory.createBus();
BusFactory.setDefaultBus( springBus );
return springBus;
//System.out.println( "CxfTestConfig: cxf bean" );
//return new SpringBus();
}
开发者ID:amoldavsky,项目名称:restful-api-cxf-spring-java,代码行数:13,代码来源:CxfTestConfig.java
示例19: prepare
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public void prepare() throws Exception {
// Set a system property used to configure the server. The examples all run on port 9091;
// however, the unit tests must run on a dynamic port. As such, we make the port configurable
// in the Spring context.
System.setProperty("port", "9001");
// setup the Camel context for the Camel transport
// START SNIPPET: e1
SpringBusFactory bf = new SpringBusFactory();
BusFactory.setDefaultBus(null);
Bus bus = bf.createBus("/org/apache/camel/example/camel/transport/CamelDestination.xml");
BusFactory.setDefaultBus(bus);
// END SNIPPET: e1
}
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:Server.java
示例20: getObject
import org.apache.cxf.bus.spring.SpringBusFactory; //导入依赖的package包/类
public Bus getObject() throws Exception {
bf = new SpringBusFactory();
if (cfgFiles != null) {
return bf.createBus(cfgFiles, includeDefaultBus);
} else {
return bf.createBus();
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:SpringBusFactoryBean.java
注:本文中的org.apache.cxf.bus.spring.SpringBusFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论