Examples of WSIFDynamicTypeMapping


Examples of org.apache.wsif.providers.WSIFDynamicTypeMapping

        Deserializer soapDeserializer = beanSer;
        String soapEncoding = Constants.NS_URI_SOAP_ENC;

        // initialize ApacheSOAP specific mappings here
        for (Iterator i = theTypeMap.iterator(); i.hasNext();) {
            WSIFDynamicTypeMapping mapping = (WSIFDynamicTypeMapping) i.next();

            Class javaClass = mapping.getJavaType();
            org.apache.soap.util.xml.QName typeName =
                new org.apache.soap.util.xml.QName(
                    mapping.getXmlType().getNamespaceURI(),
                    mapping.getXmlType().getLocalPart());
                   
            // Add mappings to a local hashmap for use in preparation of the operation
            theLocalTypeMap.put(typeName, javaClass);

            Serializer ser = null;
View Full Code Here

Examples of org.apache.wsif.providers.WSIFDynamicTypeMapping

      WSIFMessage context)
      throws WSIFException {
       
    Class objClass;
    String namespaceURI, localPart;
    WSIFDynamicTypeMapping wsifdynamictypemapping;
    for (Iterator iterator = typeMap.iterator(); iterator.hasNext();) {
      wsifdynamictypemapping = (WSIFDynamicTypeMapping) iterator.next();
      objClass = wsifdynamictypemapping.getJavaType();
      QName xmlType = wsifdynamictypemapping.getXmlType();

      SerializerFactory sf = null;
      DeserializerFactory df = null;
     
      // the context may override the default (de)serializer for a type
      TypeSerializerInfo contextTypeSerializer =
          findContextTypeSerialzer(context, objClass, xmlType);
      if (contextTypeSerializer != null) {
        objClass = contextTypeSerializer.getJavaType();
        xmlType = contextTypeSerializer.getElementType();
             sf = (SerializerFactory) contextTypeSerializer.getSerializer();
             df = (DeserializerFactory) contextTypeSerializer.getDeserializer();
      }
     
        if (sf == null && tm.getSerializer(objClass, xmlType) == null) {
                if (objClass.isArray()) {
              sf = new ArraySerializerFactory();
            } else if (SimpleType.class.isAssignableFrom(objClass)) {
              sf = new SimpleSerializerFactory(objClass, xmlType);
            } else {
              sf = new BeanSerializerFactory(objClass, xmlType);
               }
        }

           if (df == null && tm.getDeserializer(objClass, xmlType) == null) {
            if (objClass.isArray()) {
              df = new ArrayDeserializerFactory();
            } else if (SimpleType.class.isAssignableFrom(objClass)) {
              df = new SimpleDeserializerFactory(objClass, xmlType);
              } else {
                df = new BeanDeserializerFactory(objClass, xmlType);
            }
        }

      namespaceURI =
        wsifdynamictypemapping.getXmlType().getNamespaceURI();

      // Filter out XSD and SOAP-ENC types from those we explicitly map.     
      // Axis already knows how to deal with these; using the BeanSerializer
      // would be wrong anyway as they represent simple types and not beans.
      if (!isDefaultSOAPNamespace(namespaceURI) ) {
         
        localPart = wsifdynamictypemapping.getXmlType().getLocalPart();
        QName qn = new QName(namespaceURI, localPart);

        if (sf != null || df != null) {
          tm.register(objClass, qn, sf, df);
        }
View Full Code Here

Examples of org.apache.wsif.providers.WSIFDynamicTypeMapping

                // Look this parameter up in the typeMap.
                for (Iterator mapIt = typeMap.iterator();
                    mapIt.hasNext() && !foundThisArg;
                    ) {
                    WSIFDynamicTypeMapping mapping =
                        (WSIFDynamicTypeMapping) mapIt.next();
                    if (mapping.getXmlType().equals(partTypeName)
                    || (mapping.getXmlType().equals(partTypeNameWrapped))) {
                        if (mapping
                            .getJavaType()
                            .isAssignableFrom(types[argIndex])
                            || (args[argIndex] != null
                                && mapping.getJavaType().isAssignableFrom(
                                    args[argIndex].getClass()))) {
                            foundThisArg = true;
                            if (mapping.getJavaType().equals(types[argIndex])
                                || (args[argIndex] != null
                                    && mapping.getJavaType().equals(
                                        args[argIndex].getClass())))
                                exactMatchThisArg = true;
                        } else
                            break;
                    }
View Full Code Here

Examples of org.apache.wsif.providers.WSIFDynamicTypeMapping

            soaprmiMapping.connectTo(defaultMapping);
            // disable SoapRMI auto mapping
            soaprmiMapping.setDefaultStructNsPrefix(null);

            for (Iterator i = typeMap.iterator(); i.hasNext();) {
                WSIFDynamicTypeMapping mapping = (WSIFDynamicTypeMapping) i.next();

                // map SOAPStruct into namespace:http://soapinterop.org/ : SOAPStruct
                soaprmiMapping.mapStruct(
                    "http://schemas.xmlsoap.org/soap/encoding/",
                    mapping.getXmlType().getNamespaceURI(),
                    mapping.getXmlType().getLocalPart(),
                    mapping.getJavaType());

            }
        } catch (XmlMapException ex) {
            throw new WSIFException("Could not initialize mapping.", ex);
        }
View Full Code Here

Examples of org.apache.wsif.providers.WSIFDynamicTypeMapping

            return null;
        }
    }

    private void doItTM(QName qn, Class cls) {
        WSIFDynamicTypeMapping tm = new WSIFDynamicTypeMapping(qn, cls);

        try {
            WSIFDynamicTypeMapping tma =
                (WSIFDynamicTypeMapping) writeItReadIt(tm);
            assertNotNull(tma);
            assertEquals(
                tm.getJavaType().getName(),
                tma.getJavaType().getName());
            assertEquals(tm.getXmlType(), tma.getXmlType());
        } catch (Exception e) {
            System.out.println(
                "Error testing type mapping with for QName: "
                    + qn
                    + "and Java type: "
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.