本文整理汇总了Java中org.apache.axis.encoding.ser.BeanDeserializerFactory类的典型用法代码示例。如果您正苦于以下问题:Java BeanDeserializerFactory类的具体用法?Java BeanDeserializerFactory怎么用?Java BeanDeserializerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BeanDeserializerFactory类属于org.apache.axis.encoding.ser包,在下文中一共展示了BeanDeserializerFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _get
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
private CacheEntry _get(String cacheName,String method,String key) throws ServiceException, MalformedURLException, RemoteException {
Service service = new Service();
Call call = (Call) service.createCall();
call.registerTypeMapping(
Element.class,
element,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.addParameter("arg1", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.setReturnClass(Element.class);
call.setReturnQName(element);
return new SoapCacheEntry((Element) call.invoke( new Object[] {cacheName,key } ));
}
示例2: _remove
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
private boolean _remove(String cacheName,String method,String key) throws ServiceException, MalformedURLException, RemoteException {
Service service = new Service();
Call call = (Call) service.createCall();
call.registerTypeMapping(
Element.class,
element,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.addParameter("arg1", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.setReturnClass(boolean.class);
call.setReturnQName(Constants.XSD_BOOLEAN);
return ((Boolean)call.invoke( new Object[] {cacheName,key } )).booleanValue();
}
示例3: _put
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
private void _put(String cacheName,String method,Element el) throws ServiceException, MalformedURLException, RemoteException {
Service service = new Service();
Call call = (Call) service.createCall();
el.setResourceUri(endpoint);
call.registerTypeMapping(
Element.class,
element,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.addParameter("arg1", element, Element.class, ParameterMode.IN);
call.setReturnType(Constants.XSD_ANYSIMPLETYPE);
call.invoke( new Object[] {cacheName,el } );
//call.invokeOneWay(new Object[] {cacheName,el } );
}
示例4: registerDefaults
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public static void registerDefaults(TypeMappingRegistry tmr) {
TypeMapping tm = tmr.getDefaultTypeMapping();
if(!tm.isRegistered(QueryBean.class, RPCConstants.QUERY_QNAME))
tm.register(QueryBean.class,
RPCConstants.QUERY_QNAME,
new BeanSerializerFactory(QueryBean.class,RPCConstants.QUERY_QNAME),
new BeanDeserializerFactory(QueryBean.class,RPCConstants.QUERY_QNAME));
//Adding custom string serialization for non printable characters.
tm.register(String.class,
RPCConstants.STRING_QNAME,
new StringSerializerFactory(String.class, RPCConstants.STRING_QNAME),
new StringDeserializerFactory(String.class, RPCConstants.STRING_QNAME));
}
示例5: registerBeanTypeMapping
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public static void registerBeanTypeMapping(javax.xml.rpc.encoding.TypeMapping tm, Class clazz, QName qName) {
if(tm.isRegistered(clazz, qName)) return;
if(clazz.isArray()) {
QName ct=AxisCaster.toComponentType(qName,null);
if(ct!=null) {
tm.register(
clazz,
qName,
new ArraySerializerFactory(clazz, ct),
new ArrayDeserializerFactory(ct));
return;
}
}
tm.register(
clazz,
qName,
new BeanSerializerFactory(clazz, qName),
new BeanDeserializerFactory(clazz, qName));
}
示例6: main
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Options opts = new Options(args);
String uri = "http://faults.samples";
String serviceName = "EmployeeInfoService";
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service service = serviceFactory.createService(new QName(uri, serviceName));
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping map = registry.getDefaultTypeMapping();
QName employeeQName = new QName("http://faults.samples", "Employee");
map.register(Employee.class, employeeQName, new BeanSerializerFactory(Employee.class, employeeQName), new BeanDeserializerFactory(Employee.class, employeeQName));
QName faultQName = new QName("http://faults.samples", "NoSuchEmployeeFault");
map.register(NoSuchEmployeeFault.class, faultQName, new BeanSerializerFactory(NoSuchEmployeeFault.class, faultQName), new BeanDeserializerFactory(NoSuchEmployeeFault.class, faultQName));
Call call = service.createCall();
call.setTargetEndpointAddress(new URL(opts.getURL()).toString());
call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://faults.samples");
call.setOperationName( new QName(uri, "getEmployee") );
String[] args2 = opts.getRemainingArgs();
System.out.println("Trying :" + args2[0]);
Employee emp = (Employee) call.invoke(new Object[]{ args2[0] });
System.out.println("Got :" + emp.getEmployeeID());
}
示例7: validateToken
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public static Result validateToken(String remoteAddr, String token) throws ServiceException, RemoteException {
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setEncodingStyle(nameSpace);//传非字符串类型参数需要明确
QName qn = new QName(nameSpace, "Result");
call.setReturnType(qn, Result.class);
call.registerTypeMapping(Result.class, qn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
call.setOperationName(new QName(nameSpace, "userLogon"));
call.addParameter("remoteAddr", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("appID", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("token", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("timestamp", XMLType.XSD_LONG, ParameterMode.IN);
call.addParameter("msgAbstract", XMLType.XSD_STRING, ParameterMode.IN);
long timestamp = new java.util.Date().getTime();
String msgBofore = remoteAddr + appID + token + timestamp + key;
String msg = "";
Result user = null;
try {
byte[] msgByte = java.security.MessageDigest.getInstance("MD5").digest(msgBofore.getBytes());
msg = bytes2HexString(msgByte);
user = (Result) call.invoke(new Object[]{remoteAddr, appID, token, timestamp, msg});
} catch (Exception e) {
e.printStackTrace();
}
return user;
}
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:29,代码来源:IaaaValidation.java
示例8: getSinglePerson
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public static Result getSinglePerson(String personID) throws ServiceException, RemoteException {
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(personUrl);
QName qn = new QName(personNameSpace, "Result");
call.setReturnType(qn, Result.class);
call.registerTypeMapping(Result.class, qn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
call.setOperationName(new QName(personNameSpace, "getSinglePerson"));
call.addParameter("personID", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("euid", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("personName", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("nameAbbr", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("deptID", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("userType", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("appID", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("appIP", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("messageAbstract", XMLType.XSD_STRING, ParameterMode.IN);
String msgBofore = personID + "7696baa1fa4ed9679441764a271e556e";
String msg = "";
try {
byte[] msgByte = java.security.MessageDigest.getInstance("MD5").digest(msgBofore.getBytes());
msg = bytes2HexString(msgByte);
} catch (Exception e) {
e.printStackTrace();
}
Result user = (Result) call.invoke(new Object[]{personID, "", "", "", "", "", "dvn", "162.105.138.117", msg});
return user;
}
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:28,代码来源:IaaaValidation.java
示例9: registerClass
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
/**
* Registers the specified Class with the current MessageContext's TypeMapping
* for use by Axis. This method will remove any existing entries for the same
* class type (QName equivalence) before adding new Bean
* serializer/deserializer entries.
*
* @param kls
*/
public void registerClass(Class<?> kls) {
// Add ser/deser pairs for these classes
TypeMapping tm = msgContext.getTypeMapping();
QName xmlType = convertToQName(kls, this.scheme);
if (!tm.isRegistered(kls, xmlType)) {
SerializerFactory sf = new BeanSerializerFactory(kls, xmlType);
DeserializerFactory dsf = new BeanDeserializerFactory(kls, xmlType);
tm.register(kls, xmlType, sf, dsf);
}
}
示例10: buy
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public String buy(String serverURL, int quantity, int numItems, double price)
throws Exception
{
try {
int i ;
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new URL(serverURL) );
call.setUseSOAPAction( true );
call.setSOAPActionURI( "http://www.soapinterop.org/Buy" );
call.setReturnType( XMLType.XSD_STRING );
/* sd.addOutputParam("BuyResult",
SOAPTypeMappingRegistry.XSD_STRING);
sd.addOutputParam("Result",
SOAPTypeMappingRegistry.XSD_STRING);
sd.addOutputParam("return",
SOAPTypeMappingRegistry.XSD_STRING); */
// register the PurchaseOrder class
QName poqn = new QName("http://www.soapinterop.org/Bid", "PurchaseOrder");
Class cls = PurchaseOrder.class;
call.registerTypeMapping(cls, poqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
// register the Address class
QName aqn = new QName("http://www.soapinterop.org/Bid", "Address");
cls = Address.class;
call.registerTypeMapping(cls, aqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
// register the LineItem class
QName liqn = new QName("http://www.soapinterop.org/Bid", "LineItem");
cls = LineItem.class;
call.registerTypeMapping(cls, liqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
LineItem[] lineItems = new LineItem[numItems];
for ( i = 0 ; i < numItems ; i++ )
lineItems[i] = new LineItem("Widget"+i,quantity,new BigDecimal(price));
PurchaseOrder po = new PurchaseOrder( "PO1",
Calendar.getInstance(),
new Address("Mr Big",
"40 Wildwood Lane",
"Weston",
"CT",
"06883"),
new Address("Mr Big's Dad",
"40 Wildwood Lane",
"Weston",
"CT",
"06883"),
lineItems );
call.addParameter( "PO", poqn, ParameterMode.IN );
call.setOperationName( new QName("http://www.soapinterop.org/Bid", "Buy") );
String res = (String) call.invoke( new Object[] { po } );
return( res );
}
catch( Exception e ) {
e.printStackTrace();
throw e ;
}
}
示例11: main
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
/**
* Main entry point. Tests a variety of echo methods and reports
* on their results.
*
* Arguments are of the form:
* -h localhost -p 8080 -s /soap/servlet/rpcrouter
*/
public static void main(String args[]) throws Exception {
// set up the call object
Options opts = new Options(args);
service = new Service();
call = (Call) service.createCall();
call.setTargetEndpointAddress( new URL(opts.getURL()) );
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://www.soapinterop.org/Bid");
// register the PurchaseOrder class
QName poqn = new QName("http://www.soapinterop.org/Bid",
"PurchaseOrder");
Class cls = PurchaseOrder.class;
call.registerTypeMapping(cls, poqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
// register the Address class
QName aqn = new QName("http://www.soapinterop.org/Bid", "Address");
cls = Address.class;
call.registerTypeMapping(cls, aqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
// register the LineItem class
QName liqn = new QName("http://www.soapinterop.org/Bid", "LineItem");
cls = LineItem.class;
call.registerTypeMapping(cls, liqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
try {
// Default return type based on what we expect
call.setOperationName( new QName("http://www.soapinterop.org/Bid", "Buy" ));
call.addParameter( "PO", poqn, ParameterMode.IN );
call.setReturnType( XMLType.XSD_STRING );
LineItem[] li = new LineItem[2];
li[0] = new LineItem("Tricorder", 1, "2500.95");
li[1] = new LineItem("Phasor", 3, "7250.95");
PurchaseOrder po = new PurchaseOrder(
"NCC-1701",
Calendar.getInstance(),
new Address("Sam Ruby", "Home", "Raleigh", "NC", "27676"),
new Address("Lou Gerstner", "Work", "Armonk", "NY", "15222"),
li
);
// issue the request
String receipt = (String) call.invoke( new Object[] {po} );
System.out.println(receipt);
} catch (Exception e) {
System.out.println("Buy failed: " + e);
throw e;
}
}
示例12: register
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
protected void register(Call call, Class klass, QName qname) {
call.registerTypeMapping(klass, qname, BeanSerializerFactory.class,
BeanDeserializerFactory.class);
}
示例13: registerType
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
private void registerType(JaxRpcTypeInfo type, TypeMapping typeMapping) throws OpenEJBException {
Class javaType;
try {
javaType = classLoader.loadClass(type.javaType);
} catch (ClassNotFoundException e) {
throw new OpenEJBException("Could not load class for JaxRpc mapping " + type.javaType);
}
// Default uses the generic Java Beans serializer/deserializer
Class serializerFactoryClass = BeanSerializerFactory.class;
Class deserializerFactoryClass = BeanDeserializerFactory.class;
switch (type.serializerType) {
case ARRAY:
serializerFactoryClass = ArraySerializerFactory.class;
deserializerFactoryClass = ArrayDeserializerFactory.class;
break;
case ENUM:
serializerFactoryClass = EnumSerializerFactory.class;
deserializerFactoryClass = EnumDeserializerFactory.class;
break;
case LIST:
serializerFactoryClass = SimpleListSerializerFactory.class;
deserializerFactoryClass = SimpleListDeserializerFactory.class;
break;
default:
if (type.simpleBaseType != null) {
Class clazz = SOAP_TYPE_MAPPING.getClassForQName(type.simpleBaseType, null, null);
if (null != clazz) {
// Built in SOAP type
serializerFactoryClass = SOAP_TYPE_MAPPING.getSerializer(clazz, type.simpleBaseType).getClass();
deserializerFactoryClass = SOAP_TYPE_MAPPING.getDeserializer(clazz, type.simpleBaseType, null).getClass();
} else {
clazz = JAXRPC_TYPE_MAPPING.getClassForQName(type.simpleBaseType, null, null);
if (null != clazz) {
// Built in XML schema type
serializerFactoryClass = JAXRPC_TYPE_MAPPING.getSerializer(clazz, type.simpleBaseType).getClass();
deserializerFactoryClass = JAXRPC_TYPE_MAPPING.getDeserializer(clazz, type.simpleBaseType, null).getClass();
}
}
}
break;
}
SerializerFactory serializerFactory = BaseSerializerFactory.createFactory(serializerFactoryClass, javaType, type.qname);
DeserializerFactory deserializerFactory = BaseDeserializerFactory.createFactory(deserializerFactoryClass, javaType, type.qname);
typeMapping.register(javaType, type.qname, serializerFactory, deserializerFactory);
}
示例14: registerBeanMapping
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
private void registerBeanMapping(TypeMapping mapping, Class<?> type, String name) {
QName qName = new QName("urn:bioDBnet", name);
mapping.register(type, qName, new BeanSerializerFactory(type, qName), new BeanDeserializerFactory(type, qName));
}
示例15: getCache
import org.apache.axis.encoding.ser.BeanDeserializerFactory; //导入依赖的package包/类
public Cache getCache(String cacheName) throws Exception {
Service service = new Service();
TypeMapping tm = service.getTypeMappingRegistry().getDefaultTypeMapping();
TypeMappingUtil.registerBeanTypeMapping(tm, CacheConfiguration.class, cacheConfiguration);
TypeMappingUtil.registerBeanTypeMapping(tm, Cache.class, cache);
Call call = (Call) service.createCall();
call.registerTypeMapping(
Cache.class,
cache,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.registerTypeMapping(
CacheConfiguration.class,
cacheConfiguration,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", "getCache"));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.setReturnClass(Element.class);
call.setReturnQName(cache);
//Object ret = call.invoke( new Object[] { } );
return (Cache) call.invoke( new Object[] {cacheName } );
}