本文整理汇总了Java中org.apache.cxf.aegis.databinding.AegisDatabinding类的典型用法代码示例。如果您正苦于以下问题:Java AegisDatabinding类的具体用法?Java AegisDatabinding怎么用?Java AegisDatabinding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AegisDatabinding类属于org.apache.cxf.aegis.databinding包,在下文中一共展示了AegisDatabinding类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createSoapClient
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
public <T> T createSoapClient(Class<T> serviceClass, URL endpoint, String namespace)
{
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
Bus bus = new ExtensionManagerBus(null, null, Bus.class.getClassLoader());
factory.setBus(bus);
factory.setServiceClass(serviceClass);
factory.setServiceName(new QName(namespace, serviceClass.getSimpleName()));
factory.setAddress(endpoint.toString());
factory.getServiceFactory().getServiceConfigurations().add(0, new XFireCompatabilityConfiguration());
factory.setDataBinding(new AegisDatabinding());
@SuppressWarnings("unchecked")
T soapClient = (T) factory.create();
Client client = ClientProxy.getClient(soapClient);
client.getRequestContext().put(Message.MAINTAIN_SESSION, true);
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setReceiveTimeout(600000);
policy.setAllowChunking(false);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
conduit.setClient(policy);
return soapClient;
}
开发者ID:equella,项目名称:Equella,代码行数:22,代码来源:SoapClientFactory.java
示例2: createSoap
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> T createSoap(Class<T> serviceClass, URL endpoint, String namespace, Object previousSession)
{
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.setServiceClass(serviceClass);
factory.setServiceName(new QName(namespace, serviceClass.getSimpleName()));
factory.setAddress(endpoint.toString());
List<AbstractServiceConfiguration> configs = factory.getServiceFactory().getServiceConfigurations();
configs.add(0, new XFireReturnTypeConfig());
factory.setDataBinding(new AegisDatabinding());
T service = (T) factory.create();
Client client = ClientProxy.getClient(service);
client.getRequestContext().put(Message.MAINTAIN_SESSION, true);
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setReceiveTimeout(600000);
policy.setAllowChunking(false);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
conduit.setClient(policy);
if( previousSession != null )
{
copyCookiesInt(conduit, previousSession);
}
return service;
}
开发者ID:equella,项目名称:Equella,代码行数:25,代码来源:SoapHelper.java
示例3: addService
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
/**
* Creates a webservice endpoint for an interface/implementation pair based on their fullnames<p>
* Classes and Interfaces to be used as webservice should be made available in the pom.xml
*
* @param serviceInterface The interface fullname of the webservice to be added
* @param serviceImplementation The implementation class fullname of the webservice to be added
* @throws Exception
* @see WebServiceServlet, ServerFactoryBean
*/
public void addService(String serviceInterface, String serviceImplementation) throws Exception
{
String serviceName = extractServiceName(serviceInterface);
ServerFactoryBean svrFactory = new ServerFactoryBean();
try {
if(bus != null) {
svrFactory.setBus(bus);
}
svrFactory.setServiceClass(Class.forName(serviceInterface));
svrFactory.setAddress(baseAddress + serviceName);
svrFactory.setServiceBean(Class.forName(serviceImplementation).newInstance());
svrFactory.getServiceFactory().setDataBinding(new AegisDatabinding());
svrFactory.create();
System.out.println(svrFactory.getServiceFactory().getEndpointInfo().getAddress());
} catch (Exception e) {
logger.error("Error adding webservices with interface : " + serviceInterface + " and implementation : " + serviceImplementation, e);
throw e;
}
}
开发者ID:qafedev,项目名称:qafe-platform,代码行数:30,代码来源:GenericWebServiceServer.java
示例4: setUp
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
@Before
public void setUp() {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
Map<String, Object> props = new HashMap<String, Object>();
List<String> list = new ArrayList<String>();
list.add(People.class.getName());
list.add(Boy.class.getName());
list.add(Person.class.getName());
props.put("writeXsiType", Boolean.TRUE);
props.put("overrideTypesList", list);
factory.getServiceFactory().setProperties(props);
factory.setDataBinding(new AegisDatabinding());
factory.setAddress(ENDPOINT);
personService = (PersonServiceWithBaseClass)factory.create(PersonServiceWithBaseClass.class);
// bind the outbound interceptor to the client proxy
Client proxy = ClientProxy.getClient(personService);
proxy.getOutInterceptors().add(new SystemTokenClientInterceptor(SYSTEM_NIC, SYSTEM_NIC_PW));
}
开发者ID:brightzheng100,项目名称:learning-spring-cxf,代码行数:23,代码来源:PersonWebServiceWithBaseClassTest.java
示例5: getNewClient
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
protected SoapHarvesterService getNewClient(String url, String sharedId, String sharedValue, String username)
{
try
{
final URL endpointUrl = new URL(new URL(url), HARVESTER_ENDPOINT);
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
Bus bus = new ExtensionManagerBus(null, null, Bus.class.getClassLoader());
factory.setBus(bus);
factory.setServiceClass(SoapHarvesterService.class);
factory.setServiceName(
new QName("http://soap.harvester.core.tle.com", SoapHarvesterService.class.getSimpleName()));
factory.setAddress(endpointUrl.toString());
factory.setDataBinding(new AegisDatabinding());
List<AbstractServiceConfiguration> configs = factory.getServiceFactory().getServiceConfigurations();
configs.add(0, new XFireReturnTypeConfig());
SoapHarvesterService soapClient = (SoapHarvesterService) factory.create();
Client client = ClientProxy.getClient(soapClient);
client.getRequestContext().put(Message.MAINTAIN_SESSION, true);
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setReceiveTimeout(600000);
policy.setAllowChunking(false);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
// Works?
// conduit.getTlsClientParameters().setSSLSocketFactory(BlindSSLSocketFactory.getDefaultSSL());
conduit.setClient(policy);
soapClient.loginWithToken(TokenGenerator.createSecureToken(username, sharedId, sharedValue, null));
return soapClient;
}
catch( Exception x )
{
LOGGER.error("Error connecting to remote EQUELLA server", x);
throw new RuntimeException(
CurrentLocale.get("com.tle.core.remoterepo.equella.error.communication", x.getMessage()));
}
}
开发者ID:equella,项目名称:Equella,代码行数:38,代码来源:EquellaRepoServiceImpl.java
示例6: setUp
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
@Before
public void setUp() {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
factory.setAddress(ENDPOINT);
service = (SayHiService) factory.create(SayHiService.class);
}
开发者ID:brightzheng100,项目名称:learning-spring-cxf,代码行数:8,代码来源:SayHiWebServiceTest.java
示例7: setup
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
public void setup(Class<?> serviceClass, String wsUrl) {
ClientFactoryBean factory = new ClientFactoryBean();
factory.setServiceClass(serviceClass);
factory.setAddress(wsUrl);
AegisDatabinding aegisDatabinding = new AegisDatabinding();
AegisContext aegisCtx = new AegisContext();
aegisCtx.setReadXsiTypes(true);
aegisDatabinding.setAegisContext(aegisCtx);
factory.getServiceFactory().setDataBinding(aegisDatabinding);
client = factory.create();
}
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:12,代码来源:CXFAegisWSCaller.java
示例8: setUp
import org.apache.cxf.aegis.databinding.AegisDatabinding; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Before
public void setUp() {
Map<String, Object> props = new HashMap<String, Object>();
List<String> list = new ArrayList<String>();
list.add(People.class.getName());
list.add(Boy.class.getName());
list.add(Person.class.getName());
props.put("writeXsiType", Boolean.TRUE);
props.put("overrideTypesList", list);
//BOY Service
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getServiceFactory().setProperties(props);
factory.setDataBinding(new AegisDatabinding());
factory.setServiceClass(PersonServiceWithGeneric.class);
factory.setAddress(ENDPOINT);
boyService = (PersonServiceWithGeneric<Boy, String>) factory.create();
// bind the outbound interceptor to the client proxy
Client proxy1 = ClientProxy.getClient(boyService);
proxy1.getOutInterceptors().add(new SystemTokenClientInterceptor(SYSTEM_NIC, SYSTEM_NIC_PW));
//PERSON Service
JaxWsProxyFactoryBean factory2 = new JaxWsProxyFactoryBean();
factory2.getServiceFactory().setProperties(props);
factory2.getServiceFactory().setDataBinding(new AegisDatabinding());
factory2.setAddress(ENDPOINT);
personService = (PersonServiceWithGeneric<Person, String>)factory2.create(PersonServiceWithGeneric.class);
// bind the outbound interceptor to the client proxy
Client proxy2 = ClientProxy.getClient(personService);
proxy2.getOutInterceptors().add(new SystemTokenClientInterceptor(SYSTEM_NIC, SYSTEM_NIC_PW));
//Generic Service?
JaxWsProxyFactoryBean factory3 = new JaxWsProxyFactoryBean();
factory3.getServiceFactory().setProperties(props);
factory3.getServiceFactory().setDataBinding(new AegisDatabinding());
factory3.setAddress(ENDPOINT);
genericService = (PersonServiceWithGeneric<? super Person, String>)factory3.create(PersonServiceWithGeneric.class);
// bind the outbound interceptor to the client proxy
Client proxy3 = ClientProxy.getClient(genericService);
proxy3.getOutInterceptors().add(new SystemTokenClientInterceptor(SYSTEM_NIC, SYSTEM_NIC_PW));
}
开发者ID:brightzheng100,项目名称:learning-spring-cxf,代码行数:52,代码来源:PersonWebServiceWithGenericTest.java
注:本文中的org.apache.cxf.aegis.databinding.AegisDatabinding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论