Package org.apache.axis.description

Examples of org.apache.axis.description.ParameterDesc


        // chooses to allow parameters to be added when
        // parmAndRetReq==false.  This does not conflict with
        // JSR 101 which indicates an exception MAY be thrown.

        //if (parmAndRetReq) {
        ParameterDesc param = new ParameterDesc();
        param.setQName( paramName );
        param.setTypeQName( xmlType );
        param.setJavaType( javaType );
        byte mode = ParameterDesc.IN;
        if (parameterMode == ParameterMode.INOUT) {
            mode = ParameterDesc.INOUT;
        } else if (parameterMode == ParameterMode.OUT) {
            mode = ParameterDesc.OUT;
        }
        param.setMode(mode);
       
        operation.addParameter(param);
        parmAndRetReq = true;
        //}
        //else {
View Full Code Here


     *
     * @param  paramQName  QName of the parameter to return
     * @return XMLType    XMLType of paramQName, or null if not found.
     */
    public QName getParameterTypeByQName(QName paramQName) {
        ParameterDesc param = operation.getParamByQName(paramQName);
        if (param != null) {
            return param.getTypeQName();
        }
        return( null );
    }
View Full Code Here

        Vector result = new Vector();
        int    j = 0 ;
        ArrayList parameters = operation.getParameters();

        for ( i = 0 ; i < parameters.size() ; i++ ) {
            ParameterDesc param = (ParameterDesc)parameters.get(i);
            if (param.getMode() == ParameterDesc.OUT)
                continue ;

            QName paramQName = param.getQName();
            RPCParam rpcParam = null;
            Object p = params[j++];
            if(p instanceof RPCParam) {
                rpcParam = (RPCParam)p;
            } else {
View Full Code Here

    /**
     * Get the javaType for a given parameter.
     *
     */
    private Class getJavaTypeForQName(QName name) {
        ParameterDesc param = operation.getOutputParamByQName(name);
        return param == null ? null : param.getJavaType();
    }
View Full Code Here

        }

        for (Iterator iter = operations.iterator(); iter.hasNext();) {
            OperationDesc operationDesc = (OperationDesc) iter.next();
            ArrayList parameters = new ArrayList(operationDesc.getParameters());
            ParameterDesc returnParameterDesc = operationDesc.getReturnParamDesc();
            if (null != returnParameterDesc.getTypeQName() &&
                    false == returnParameterDesc.getTypeQName().equals(XMLType.AXIS_VOID)) {
                parameters.add(returnParameterDesc);
            }
            for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
                ParameterDesc parameterDesc = (ParameterDesc) iterator.next();
                QName typeQName = parameterDesc.getTypeQName();
                if (null == typeQName) {
                    continue;
                } else if (mappedTypeQNames.contains(typeQName)) {
                    continue;
                } else if (typeQName.getNamespaceURI().equals(XML_SCHEMA_NS) ||
                        typeQName.getNamespaceURI().equals(SOAP_ENCODING_NS)) {
                    continue;
                }

                SchemaTypeKey key = (SchemaTypeKey) qNameToKey.get(typeQName);
                if (null == key) {
                    log.warn("Type QName [" + typeQName + "] defined by operation [" +
                            operationDesc + "] has not been found in schema: " + schemaTypeKeyToSchemaTypeMap);
                    continue;
                }
                SchemaType schemaType = (SchemaType) schemaTypeKeyToSchemaTypeMap.get(key);
                mappedTypeQNames.add(key.getqName());

                if (false == schemaType.isSimpleType()) {
                    if (false == parameterDesc.getJavaType().isArray()) {
                        if (false == mappedTypeQNames.contains(schemaType.getName())) {
                            // TODO: this lookup is not enough: the jaxrpc mapping file may define an anonymous
                            // mapping.
                            log.warn("Operation [" + operationDesc + "] uses XML type [" + schemaType +
                                    "], whose mapping is not declared by the jaxrpc mapping file.\n Continuing deployment; " +
                                    "yet, the deployment is not-portable.");
                        }
                        continue;
                    }
                }

                Class clazz = parameterDesc.getJavaType();
                TypeInfo.UpdatableTypeInfo internalTypeInfo =  defineSerializerPair(schemaType, clazz);
                setTypeQName(internalTypeInfo, key);
                internalTypeInfo.setFields(new FieldDesc[0]);

                typeInfoList.add(internalTypeInfo.buildTypeInfo());
View Full Code Here

        }
       
        MessageElement curEl = context.getCurElement();
        QName type = null;
        QName qname = new QName(namespace, localName);
        ParameterDesc paramDesc = null;

        Vector params = rpcElem.getParams();
       
        // SAR: for now, ignore RPC Result elements
        if (qname.equals(Constants.QNAME_RPC_RESULT)) return this;

        // 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(JavaUtils.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) {
                paramDesc = operation.getParameter(params.size() - 1);
            }
           
           
            if (paramDesc == null) {
                throw new SAXException("operation description is missing parameter description!");
            }
            destClass = paramDesc.getJavaType();
           
            // 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 (dser == null) {
                  throw new SAXException(JavaUtils.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 (!JavaUtils.isConvertable(xsiClass, destClass)) {
View Full Code Here

        // chooses to allow parameters to be added when
        // parmAndRetReq==false.  This does not conflict with
        // JSR 101 which indicates an exception MAY be thrown.

        //if (parmAndRetReq) {
        ParameterDesc param = new ParameterDesc();
        param.setQName( paramName );
        param.setTypeQName( xmlType );
        param.setJavaType( javaType );
        byte mode = ParameterDesc.IN;
        if (parameterMode == ParameterMode.INOUT) {
            mode = ParameterDesc.INOUT;
        } else if (parameterMode == ParameterMode.OUT) {
            mode = ParameterDesc.OUT;
        }
        param.setMode(mode);
       
        operation.addParameter(param);
        parmAndRetReq = true;
        //}
        //else {
View Full Code Here

     *
     * @param  paramQName  QName of the parameter to return
     * @return XMLType    XMLType of paramQName, or null if not found.
     */
    public QName getParameterTypeByQName(QName paramQName) {
        ParameterDesc param = operation.getParamByQName(paramQName);
        if (param != null) {
            return param.getTypeQName();
        }
        return( null );
    }
View Full Code Here

        Vector result = new Vector();
        int    j = 0 ;
        ArrayList parameters = operation.getParameters();

        for ( i = 0 ; i < parameters.size() ; i++ ) {
            ParameterDesc param = (ParameterDesc)parameters.get(i);
            if (param.getMode() == ParameterDesc.OUT)
                continue ;

            QName paramQName = param.getQName();
            RPCParam rpcParam = null;
            Object p = params[j++];
            if(p instanceof RPCParam) {
                rpcParam = (RPCParam)p;
            } else {
View Full Code Here

    /**
     * Get the javaType for a given parameter.
     *
     */
    private Class getJavaTypeForQName(QName name) {
        ParameterDesc param = operation.getOutputParamByQName(name);
        return param == null ? null : param.getJavaType();
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.description.ParameterDesc

Copyright © 2018 www.massapicom. 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.