use of javax.xml.rpc.encoding.DeserializerFactory in project tomee by apache.
the class JavaServiceDescBuilder method registerType.
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);
}
use of javax.xml.rpc.encoding.DeserializerFactory in project tomee by apache.
the class TypeInfo method register.
public void register(TypeMapping typeMapping) {
SerializerFactory ser = BaseSerializerFactory.createFactory(serFactoryClass, clazz, qName);
DeserializerFactory deser = BaseDeserializerFactory.createFactory(deserFactoryClass, clazz, qName);
typeMapping.register(clazz, qName, ser, deser);
}
use of javax.xml.rpc.encoding.DeserializerFactory in project tdi-studio-se by Talend.
the class DynamicInvoker method getParamData.
/**
* Method getParamData
*
* @param c
* @param arg
*/
private Object getParamData(org.apache.axis.client.Call c, Parameter p, String arg) throws Exception {
// Get the QName representing the parameter type
QName paramType = org.apache.axis.wsdl.toJava.Utils.getXSIType(p);
TypeEntry type = p.getType();
if (type.isBaseType()) {
DeserializerFactory factory = c.getTypeMapping().getDeserializer(paramType);
Deserializer deserializer = factory.getDeserializerAs(Constants.AXIS_SAX);
if (deserializer instanceof SimpleDeserializer) {
return ((SimpleDeserializer) deserializer).makeValue(arg);
}
}
throw new RuntimeException("not know how to convert '" + arg + "' into " + c);
}
Aggregations