Examples of DeserializerImpl


Examples of org.apache.axis.encoding.DeserializerImpl

        Deserializer dSer = null;
        if (itemType != null) {
            dSer = context.getDeserializerForType(itemType);
        }
        if (dSer == null) {
            dSer = new DeserializerImpl()
            // Determine a default type for the deserializer
            if (itemType == null) {
                QName defaultType = defaultItemType;
                // If defaultType is not known, try using the arrayClass info
                if (defaultType == null &&
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

        String isNil = attributes.getValue(Constants.URI_2001_SCHEMA_XSI,
                                           "nil");

        if ( isNil != null && isNil.equals("true") )
          return( (SOAPHandler) new DeserializerImpl() );
       
        Deserializer dser;
        if (type != null) {
            dser = context.getDeserializerForType(type);
        } else {
            dser = new DeserializerImpl();
        }

        if (dser == null) {
            throw new SAXException(JavaUtils.getMessage(
                    "noDeser01", localName,"" + type));
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

            }
        }


        if (JavaUtils.isTrueExplicitly(attributes.getValue(Constants.URI_2001_SCHEMA_XSI, "nil")))
          return new DeserializerImpl();
       
        Deserializer dser = null;
        if ((type == null) && (namespace != null) && (!namespace.equals(""))) {
            dser = context.getDeserializerForType(qname);
        }
        if (dser == null) {
          if (type != null) {
              dser = context.getDeserializerForType(type);
          } else {
              dser = new DeserializerImpl();
          }
        }

        if (dser == null) {
            throw new SAXException(JavaUtils.getMessage(
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

            // register callback for the data, use the xmlType from fault info
            Deserializer dser = null;
            if (attributes.getValue(soapConstants.getAttrHref()) == null) {
                dser = context.getDeserializerForType(faultXmlType);
            } else {
                dser = new DeserializerImpl();
                dser.setDefaultType(faultXmlType);
            }
            if (dser != null) {
                dser.registerValueTarget(new CallbackTarget(this, "faultData"));
            }
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

        SOAPConstants soapConstants = context.getMessageContext().getSOAPConstants();
        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS &&
            Constants.QNAME_RPC_RESULT.equals(qname)) {
            // TODO: fix it ... now we just skip it
            return new DeserializerImpl();
        }

        Vector params = rpcElem.getParams();
       
        // Create a new param if not the same element
        if (currentParam == null ||
            !currentParam.getQName().getNamespaceURI().equals(namespace) ||
            !currentParam.getQName().getLocalPart().equals(localName)) {
            currentParam = new RPCParam(namespace, localName, null);
            rpcElem.addParam(currentParam);
        }

        // Grab xsi:type attribute if present, on either this element or
        // the referent (if it's an href).  MessageElement.getType() will
        // automatically dig through to the referent if necessary.
        type = curEl.getType();
        if (type == null) {
            type = context.getTypeFromAttributes(namespace,
                                                 localName,
                                                 attributes);
        }

        if (log.isDebugEnabled()) {
            log.debug(Messages.getMessage("typeFromAttr00", "" + type));
        }
       

        Class destClass = null;

        // If we have an operation descriptor, try to associate this parameter
        // with the appropriate ParameterDesc
        if (operation != null) {
           
            // Try by name first
            if (isResponse) {
                paramDesc = operation.getOutputParamByQName(qname);
            } else {
                paramDesc = operation.getInputParamByQName(qname);
            }

           
            // If that didn't work, try position
            // FIXME : Do we need to be in EITHER named OR positional
            //         mode?  I.e. will it screw us up to find something
            //         by position if we've already looked something up
            //         by name?  I think so...
            if (paramDesc == null) {
                if (isResponse) {
                    paramDesc = operation.getReturnParamDesc();
                }
                else {
                    paramDesc = operation.getParameter(params.size() - 1);
                }
            }
           
            if (paramDesc == null) {
                throw new SAXException(Messages.getMessage("noParmDesc"));
            }
            // Make sure that we don't find body parameters that should
            // be in the header
            if (!isHeaderElement &&
                ((isResponse && paramDesc.isOutHeader()) ||
                 (!isResponse && paramDesc.isInHeader()))) {
                throw new SAXException(
                    Messages.getMessage("expectedHeaderParam",
                                        paramDesc.getQName().toString()));
            }

            destClass = paramDesc.getJavaType();
            if ((destClass != null) && (destClass.isArray())) {
                context.setDestinationClass(destClass);
            }
           
            // Keep the association so we can use it later
            // (see RPCProvider.processMessage())
            currentParam.setParamDesc(paramDesc);
           
            if (type == null) {
                type = paramDesc.getTypeQName();
            }
        }
           
        // If the nil attribute is set, just
        // return the base DeserializerImpl.
        // Register the value target to set the value
        // on the RPCParam.  This is necessary for cases like
        //  <method>
        //    <foo>123</foo>
        //    <foo>456</foo>
        //    <foo xsi:nil="true" />
        //  </method>
        // so that a list of 3 items is created.
        // Failure to register the target would result in the last
        // item not being added to the list
        if (context.isNil(attributes)) {
          Deserializer nilDSer =  new DeserializerImpl();
          nilDSer.registerValueTarget(
             new MethodTarget(currentParam,
                              RPCParam.getValueSetMethod()));
          return (SOAPHandler) nilDSer;
        }
       
        Deserializer dser = null;
        if ((type == null) && (namespace != null) && (!namespace.equals(""))) {
            dser = context.getDeserializerForType(qname);
        } else {
            dser = context.getDeserializer(destClass, type);
        }
       
        if (dser == null) {
          if (type != null) {
              dser = context.getDeserializerForType(type);
              if(null != destClass && dser == null && destClass.isAssignableFrom( org.w3c.dom.Element.class )){
                //If a DOM element is expected, as last resort always allow direct mapping
                // of parameter's SOAP xml to a DOM element.  Support of literal  parms by default.
                dser = context.getDeserializerForType(Constants.SOAP_ELEMENT);

              }
              if (dser == null) {
                dser = context.getDeserializerForClass(destClass);
              }
              if (dser == null) {
                  throw new SAXException(Messages.getMessage(
                          "noDeser01", localName,"" + type));
              }
              if (paramDesc != null && paramDesc.getJavaType() != null) {
                  // If we have an xsi:type, make sure it makes sense
                  // with the current paramDesc type
                  Class xsiClass =
                          context.getTypeMapping().getClassForQName(type);
                  if (null != xsiClass  && !JavaUtils.isConvertable(xsiClass, destClass)) {
                      throw new SAXException("Bad types (" +
                                             xsiClass + " -> " + destClass + ")"); // FIXME!
                  }
              }
          } else {
              dser = context.getDeserializerForClass(destClass);
              if (dser == null) {
                  dser = new DeserializerImpl();
              }
          }
        }

        dser.setDefaultType(type);
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

            // If no deserializer is
            // found, the deserializer is set to DeserializerImpl().
            // It is possible that the element has an href, thus we
            // won't know the type until the definitition is encountered.
            if (dSer == null) {
                dSer = new DeserializerImpl();
                // Determine a default type for the deserializer
                if (itemType == null) {
                    dSer.setDefaultType(defaultType);
                }
            }
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

            // default type is used if the href'd element does
            // not have an xsi:type.
            if (href == null) {
                dSer = context.getDeserializer(javaType, defaultXMLType);
            } else {
                dSer = new DeserializerImpl();
                context.setDestinationClass(javaType);
                dSer.setDefaultType(defaultXMLType);
            }
        }
        if (javaType.equals(String.class) &&
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

                // register callback for the data, use the xmlType from fault info
                Deserializer dser = null;
                if (attributes.getValue("href") == null) {
                    dser = context.getDeserializerForType(faultDesc.getXmlType());
                } else {
                    dser = new DeserializerImpl();
                    dser.setDefaultType(faultDesc.getXmlType());
                }
                if (dser != null) {
                    dser.registerValueTarget(new CallbackTarget(this, "faultData"));
                }
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

        //  </method>
        // so that a list of 3 items is created.
        // Failure to register the target would result in the last
        // item not being added to the list
        if (context.isNil(attributes)) {
          Deserializer nilDSer =  new DeserializerImpl();
          nilDSer.registerValueTarget(
             new MethodTarget(currentParam,
                              RPCParam.getValueSetMethod()));
          return (SOAPHandler) nilDSer;
        }
       
        Deserializer dser = null;
        if ((type == null) && (namespace != null) && (!namespace.equals(""))) {
            dser = context.getDeserializerForType(qname);
        } else {
            dser = context.getDeserializer(destClass, type);
        }
       
        if (dser == null) {
          if (type != null) {
              dser = context.getDeserializerForType(type);
              if(null != destClass && dser == null && destClass.isAssignableFrom( org.w3c.dom.Element.class )){
                //If a DOM element is expected, as last resort always allow direct mapping
                // of parameter's SOAP xml to a DOM element.  Support of literal  parms by default.
                dser = context.getDeserializer(destClass, Constants.SOAP_ELEMENT);

              }
              if (dser == null) {
                  throw new SAXException(Messages.getMessage(
                          "noDeser01", localName,"" + type));
              }
              if (paramDesc != null && paramDesc.getJavaType() != null) {
                  // If we have an xsi:type, make sure it makes sense
                  // with the current paramDesc type
                  Class xsiClass =
                          context.getTypeMapping().getClassForQName(type);
                  if (null != xsiClass  && !JavaUtils.isConvertable(xsiClass, destClass)) {
                      throw new SAXException("Bad types (" +
                                             xsiClass + " -> " + destClass + ")"); // FIXME!
                  }
              }
          } else {
              dser = new DeserializerImpl();
              if (dser == null) {
                  throw new SAXException(Messages.getMessage(
                          "noDeser01", localName,"" + type));
              }
          }
View Full Code Here

Examples of org.apache.axis.encoding.DeserializerImpl

        SOAPConstants soapConstants = context.getSOAPConstants();
        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS &&
            Constants.QNAME_RPC_RESULT.equals(qname)) {
            // TODO: fix it ... now we just skip it
            return new DeserializerImpl();
        }

        // Create a new param if not the same element
        if (currentParam == null ||
            !currentParam.getQName().getNamespaceURI().equals(namespace) ||
            !currentParam.getQName().getLocalPart().equals(localName)) {
            currentParam = new RPCParam(namespace, localName, null);
            rpcElem.addParam(currentParam);
        }

        // Grab xsi:type attribute if present, on either this element or
        // the referent (if it's an href).  MessageElement.getType() will
        // automatically dig through to the referent if necessary.
        type = curEl.getType();
        if (type == null) {
            type = context.getTypeFromAttributes(namespace,
                                                 localName,
                                                 attributes);
        }

        if (log.isDebugEnabled()) {
            log.debug(Messages.getMessage("typeFromAttr00", "" + type));
        }
       

        Class destClass = null;

        // If we have an operation descriptor, try to associate this parameter
        // with the appropriate ParameterDesc
        if (operation != null) {
           
            // Try by name first
            if (isResponse) {
                paramDesc = operation.getOutputParamByQName(qname);
            } else {
                paramDesc = operation.getInputParamByQName(qname);
            }

           
            // If that didn't work, try position
            // FIXME : Do we need to be in EITHER named OR positional
            //         mode?  I.e. will it screw us up to find something
            //         by position if we've already looked something up
            //         by name?  I think so...
            if (paramDesc == null) {
                if (isResponse) {
                    paramDesc = operation.getReturnParamDesc();
                }
                else {
                    paramDesc = operation.getParameter(rpcElem.getParams().size() - 1);
                }
            }
           
            if (paramDesc == null) {
                throw new SAXException(Messages.getMessage("noParmDesc"));
            }
            // Make sure that we don't find body parameters that should
            // be in the header
            if (!isHeaderElement &&
                ((isResponse && paramDesc.isOutHeader()) ||
                 (!isResponse && paramDesc.isInHeader()))) {
                throw new SAXException(
                    Messages.getMessage("expectedHeaderParam",
                                        paramDesc.getQName().toString()));
            }

            destClass = paramDesc.getJavaType();
            if ((destClass != null) && (destClass.isArray())) {
                context.setDestinationClass(destClass);
            }
           
            // Keep the association so we can use it later
            // (see RPCProvider.processMessage())
            currentParam.setParamDesc(paramDesc);
           
            if (type == null) {
                type = paramDesc.getTypeQName();
            }
        }

        if (type != null && type.equals(XMLType.AXIS_VOID)) {
            Deserializer nilDSer =  new DeserializerImpl();
            return (SOAPHandler) nilDSer;
        }

        // If the nil attribute is set, just
        // return the base DeserializerImpl.
        // Register the value target to set the value
        // on the RPCParam.  This is necessary for cases like
        //  <method>
        //    <foo>123</foo>
        //    <foo>456</foo>
        //    <foo xsi:nil="true" />
        //  </method>
        // so that a list of 3 items is created.
        // Failure to register the target would result in the last
        // item not being added to the list
        if (context.isNil(attributes)) {
          Deserializer nilDSer =  new DeserializerImpl();
          nilDSer.registerValueTarget(new RPCParamTarget(currentParam));
          return (SOAPHandler) nilDSer;
        }
       
        Deserializer dser = null;
        if ((type == null) && (namespace != null) && (!namespace.equals(""))) {
            dser = context.getDeserializerForType(qname);
        } else {
            dser = context.getDeserializer(destClass, type);
        }
       
        if (dser == null) {
          if (type != null) {
              dser = context.getDeserializerForType(type);
              if(null != destClass && dser == null && Element.class.isAssignableFrom(destClass)){
                //If a DOM element is expected, as last resort always allow direct mapping
                // of parameter's SOAP xml to a DOM element.  Support of literal  parms by default.
                dser = context.getDeserializerForType(Constants.SOAP_ELEMENT);

              }
              if (dser == null) {
                dser = context.getDeserializerForClass(destClass);
              }
              if (dser == null) {
                  throw new SAXException(Messages.getMessage(
                          "noDeser01", localName,"" + type));
              }
              if (paramDesc != null && paramDesc.getJavaType() != null) {
                  // If we have an xsi:type, make sure it makes sense
                  // with the current paramDesc type
                  Class xsiClass =
                          context.getTypeMapping().getClassForQName(type);
                  if (null != xsiClass  && !JavaUtils.isConvertable(xsiClass, destClass)) {
                      throw new SAXException("Bad types (" +
                                             xsiClass + " -> " + destClass + ")"); // FIXME!
                  }
              }
          } else {
              dser = context.getDeserializerForClass(destClass);
              if (dser == null) {
                  dser = new DeserializerImpl();
              }
          }
        }

        dser.setDefaultType(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.