Package org.apache.axis2.jaxws.description

Examples of org.apache.axis2.jaxws.description.ParameterDescription


            // We want to use "by Java Type" unmarshalling for
            // all objects
            Class[] javaTypes = new Class[pds.length];
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                javaTypes[i] = pd.getParameterActualType();
            }

            // Unmarshal the ParamValues from the Message
            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds,
                                                                         message,
View Full Code Here


                                                        false); // not rpc

            // We want to use "by Java Type" marshalling for
            // all objects
            for (PDElement pde : pdeList) {
                ParameterDescription pd = pde.getParam();
                Class type = pd.getParameterActualType();
                pde.setByJavaTypeClass(type);
            }

            // TODO Should we check for null output body values?  Should we check for null output header values ?
            // Put values onto the message
View Full Code Here

            // We want to use "by Java Type" unmarshalling for
            // all objects
            Class[] javaTypes = new Class[pds.length];
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                Class type = pd.getParameterActualType();
                javaTypes[i] = type;
            }

            // Unmarshall the ParamValues from the Message
            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds,
View Full Code Here

            Class[] parameters = seiMethod.getParameterTypes();
            Type[] paramaterTypes = seiMethod.getGenericParameterTypes();
            Annotation[][] annotations = seiMethod.getParameterAnnotations();

            for (int i = 0; i < parameters.length; i++) {
                ParameterDescription paramDesc = new ParameterDescriptionImpl(i, parameters[i],
                                                                              paramaterTypes[i],
                                                                              annotations[i], this);
                buildParameterList.add(paramDesc);
            }

        } else {
            ParameterDescriptionComposite pdc = null;
            Iterator<ParameterDescriptionComposite> iter =
                    methodComposite.getParameterDescriptionCompositeList().iterator();

            for (int i = 0; i < methodComposite.getParameterDescriptionCompositeList().size(); i++)
            {
                ParameterDescription paramDesc =
                        new ParameterDescriptionImpl(i,
                                                     methodComposite.getParameterDescriptionComposite(
                                                             i),
                                                     this);
                buildParameterList.add(paramDesc);
View Full Code Here

    }

    public ParameterDescription getParameterDescription(String parameterName) {
        // TODO: Validation: For BARE paramaterUse, only a single IN our INOUT paramater and a single output (either return or OUT or INOUT) is allowed
        //       Per JSR-224, Sec 3.6.2.2, pg 37
        ParameterDescription matchingParamDesc = null;
        if (parameterName != null && !parameterName.equals("")) {
            for (ParameterDescription paramDesc : parameterDescriptions) {
                if (parameterName.equals(paramDesc.getParameterName())) {
                    matchingParamDesc = paramDesc;
                    break;
View Full Code Here

        return webParamTargetNamespace;
    }

    public String getAnnoWebParamTargetNamespace(String name) {
        String returnTargetNS = null;
        ParameterDescription paramDesc = getParameterDescription(name);
        if (paramDesc != null) {
            returnTargetNS = paramDesc.getTargetNamespace();
        }
        return returnTargetNS;
    }
View Full Code Here

        }
        return webParamMode;
    }

    public boolean isAnnoWebParamHeader(String name) {
        ParameterDescription paramDesc = getParameterDescription(name);
        if (paramDesc != null) {
            return paramDesc.isHeader();
        }
        return false;
    }
View Full Code Here

            }
            return;
        }

        // If any IN or INOUT parameters are in the header, then add their QNames to the list
        ParameterDescription paramDescs[] = getParameterDescriptions();
        ArrayList understoodQNames = new ArrayList();
        if (paramDescs != null && paramDescs.length > 0) {
            for (ParameterDescription paramDesc : paramDescs) {
                if (paramDesc.isHeader()
                        && (paramDesc.getMode() == WebParam.Mode.IN
View Full Code Here

                                         boolean isRPC) {
        List<PDElement> pdeList = new ArrayList<PDElement>();

        int index = 0;
        for (int i = 0; i < params.length; i++) {
            ParameterDescription pd = params[i];

            if (pd.getMode() == Mode.IN && isInput ||
                    pd.getMode() == Mode.INOUT ||
                    pd.getMode() == Mode.OUT && !isInput) {

                // Get the matching signature argument
                Object value = sigArguments[i];

                // Don't consider async handlers, they are are not represented on the wire,
                // thus they don't have a PDElement
                if (isAsyncHandler(value)) {
                    continue;
                }

                // Convert from Holder into value
                if (isHolder(value)) {
                    value = ((Holder)value).value;
                }

                // Get the formal type representing the value
                Class formalType = pd.getParameterActualType();

                // The namespace and local name are obtained differently depending on
                // the style/use and header
                QName qName = null;
                if (pd.isHeader()) {
                    // Headers (even rpc) are marshalled with the name defined by the
                    // element= attribute on the wsd:part
                    qName = new QName(pd.getTargetNamespace(), pd.getParameterName());
                } else if (isDocLitWrapped) {
                    // For doc/lit wrapped, the localName comes from the PartName
                    qName = new QName(pd.getTargetNamespace(), pd.getPartName());
                } else if (isRPC) {
                    // Per WSI-BP, the namespace uri is unqualified
                    qName = new QName(pd.getPartName());
                } else {
                    qName = new QName(pd.getTargetNamespace(), pd.getParameterName());
                }

                // Create an Element rendering
                Element element = null;
                AttachmentDescription attachmentDesc = pd.getAttachmentDescription();
                if (attachmentDesc != null) {
                    PDElement pde = createPDElementForAttachment(pd, qName, value, formalType);
                    pdeList.add(pde);
                } else {
                    if (!marshalDesc.getAnnotationDesc(formalType).hasXmlRootElement()) {
                        /* when a schema defines a SimpleType with xsd list jaxws tooling
                         * generates artifacts with array rather than a java.util.List
                         * However the ObjectFactory definition uses a List and thus
                         * marshalling fails. Lets convert the Arrays to List and recreate
                         * the JAXBElements for the same.
                         */
                        if (pd.isListType()) {
                           
                            List<Object> list = new ArrayList<Object>();
                            if (formalType.isArray()) {
                                for (int count = 0; count < Array.getLength(value); count++) {
                                    Object obj = Array.get(value, count);
View Full Code Here

        List<PDElement> pdeList = new ArrayList<PDElement>();

        // Count
        int totalBodyBlocks = 0;
        for (int i = 0; i < params.length; i++) {
            ParameterDescription pd = params[i];

            if (pd.getMode() == Mode.IN && isInput ||
                    pd.getMode() == Mode.INOUT ||
                    pd.getMode() == Mode.OUT && !isInput) {
                if (!pd.isHeader() && !isSWAAttachment(pd)) {
                    totalBodyBlocks++;
                }
            }
        }

        if (!isInput && hasReturnInBody) {
            totalBodyBlocks++;
        }
           
        int index = (!isInput && hasReturnInBody) ? 1 : 0;
        // TODO What if return is an swa attachment, then this should start
        // at 1 not 0.
        int swaIndex = 0;
        for (int i = 0; i < params.length; i++) {
            ParameterDescription pd = params[i];

            if (pd.getMode() == Mode.IN && isInput ||
                    pd.getMode() == Mode.INOUT ||
                    pd.getMode() == Mode.OUT && !isInput) {

                // Don't consider async handlers, they are are not represented on the wire,
                // thus they don't have a PDElement
                // TODO
                //if (isAsyncHandler(param)) {
                //    continue;
                //}

                Block block = null;
                JAXBBlockContext context = new JAXBBlockContext(packages);

                AttachmentDescription attachmentDesc = pd.getAttachmentDescription();
                if (attachmentDesc == null) {
                   
                    // Normal Processing: Not an Attachment
                    // Trigger unmarshal by java type if necessary
                    if (unmarshalByJavaType != null && unmarshalByJavaType[i] != null) {
                        context.setProcessType(unmarshalByJavaType[i]);
                        context.setIsxmlList(pd.isListType());
                    }
                   
                    // Unmarshal the object into a JAXB object or JAXBElement
                    if (pd.isHeader()) {
                       
                        // Get the Block from the header
                        // NOTE The parameter name is always used to get the header
                        // element...even if the style is RPC.
                        String localName = pd.getParameterName();
                        block = message.getHeaderBlock(pd.getTargetNamespace(),
                                                       localName,
                                                       context,
                                                       factory);
                    } else {
                        if (totalBodyBlocks > 1) {
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.description.ParameterDescription

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.