Package org.apache.axis2.jaxws.description

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


            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

        ParameterDescription[] pds = opDesc.getParameterDescriptions();
       
        // If one or more operations have a generic type of Object, then
        // avoid early unmarshalling
        for (int i=0; i<pds.length; i++) {
            ParameterDescription pd = pds[i];
            if (pd.getParameterActualType() == null ||
                pd.getParameterActualType().isAssignableFrom(Object.class)) {
                return false;
            }         
        }
        if (opDesc.getResultActualType() == null ||
                opDesc.getResultActualType().isAssignableFrom(Object.class)) {
View Full Code Here

                // occurrence of elements
                pde = processOccurrence(pde);
                pdeList.set(i, pde);
               
                // Set by java type marshaling
                ParameterDescription pd = pde.getParam();
                Class type = pd.getParameterActualType();
                pde.setByJavaTypeClass(type);
            }
           
            // Put values onto the message
            MethodMarshallerUtils.toMessage(pdeList, m, packages, requestContext);
View Full Code Here

            // We want to use "by Java Type" unmarshalling for
            // all objects
            Class[] javaTypes = new Class[pds.length];
            Class[] componentJavaTypes = new Class[pds.length];
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                javaTypes[i] = pd.getParameterActualType();
                if (javaTypes[i].isArray()) {
                    componentJavaTypes[i] = javaTypes[i].getComponentType();
                } else if (javaTypes[i].isAssignableFrom(List.class)) {
                    componentJavaTypes[i] = getComponentType(pd, operationDesc, marshalDesc);
                } else {
View Full Code Here

                // occurrence of elements
                pde = processOccurrence(pde);
                pdeList.set(i, pde);
               
                // Set by java type marshaling
                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];
            Class[] componentJavaTypes = new Class[pds.length];
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                Class type = pd.getParameterActualType();
               
                if (type.isArray()) {
                    componentJavaTypes[i] = type.getComponentType();
                } else if (type.isAssignableFrom(List.class)) {
                    componentJavaTypes[i] = getComponentType(pd, operationDesc, marshalDesc);
View Full Code Here

        // 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 (log.isDebugEnabled()) {
                log.debug("  processing Parameter " + pd);
            }
           

            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) {
                   
                    boolean isBase64Binary = byte[].class.equals(javaType[i]);
                   
                   
                    // In most cases the entire java object is unmarshalled.
                    // But in some cases, the java object is a series of
                    // elements.
                    boolean unmarshalComponents = false;
                    if (pd.isListType() ||
                        javaComponentType[i] == null ||
                        isBase64Binary) {
                        context.setProcessType(javaType[i]);
                        context.setIsxmlList(pd.isListType());
                    } else {
                        context.setProcessType(javaComponentType[i]);
                        unmarshalComponents = true;
                    }
                   
                   
                    // Unmarshal the object into a JAXB object or JAXBElement
                    Element element = null;
                    if (pd.isHeader()) {
                       
                        if (log.isDebugEnabled()) {
                            log.debug("  get block from the headers");
                        }
                        // Get the Block from the header
                        // NOTE The parameter name is always used to get the header
                        // element
                        String localName = pd.getParameterName();
                        block = message.getHeaderBlock(pd.getTargetNamespace(),
                                                       localName,
                                                       context,
                                                       factory);
                        element = new Element(block.getBusinessObject(true),
                                block.getQName());
                    } else if (firstIndex[i] >= 0) {
                        if (log.isDebugEnabled()) {
                            log.debug("  get block from the " + firstIndex[i] +
                                    " to the " + lastIndex[i]);
                        }
                        // You must use this method if there are more than one body block
                        // This method may cause OM expansion
                        if (unmarshalComponents) {
                            Object container = makeContainer(javaType[i],
                                    javaComponentType[i],
                                    (lastIndex[i] - firstIndex[i]) + 1);

                            for (int blockI=firstIndex[i]; blockI<=lastIndex[i]; blockI++) {
                                block = message.getBodyBlock(blockI, context, factory);
                                Object value = block.getBusinessObject(true);
                                if (value instanceof JAXBElement) {
                                    value = ((JAXBElement) value).getValue();
                                }
                                if (log.isDebugEnabled()) {
                                    log.debug(" get Business Object " + JavaUtils.getObjectIdentity(value) + " from block " + blockI);

                                }

                                addComponent(container, value, blockI - firstIndex[i]);
                               
                            }
                            element = new Element(container,    
                                    block.getQName());

                        } else {
                            block = message.getBodyBlock(firstIndex[i], context, factory);
                            element = new Element(block.getBusinessObject(true),
                                    block.getQName());
                        }
                    }  else {
                        // Missing parameter
                        if (log.isDebugEnabled()) {
                            log.debug("  there is no block for this parameter.");
                        }
                        QName qName = new QName(pd.getTargetNamespace(), pd.getPartName());
                        if (!unmarshalComponents) {
                            element = new Element(null, qName);
                        } else {
                            Object container = makeContainer(javaType[i],
                                    javaComponentType[i], 0);
                            element = new Element(container, qName);
                        }
                    }
                   
                   
                    PDElement pde =
                        new PDElement(pd, element, javaComponentType[i] == null ? null
                                : javaComponentType[i]);
                    pdeList.add(pde);
                } else {
                    // Attachment Processing
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                        String partName = pd.getPartName();
                        String cid = null;
                        if (log.isDebugEnabled()) {
                            log.debug("Getting the attachment dataHandler for partName=" + partName);
                        }
                        if (partName != null && partName.length() > 0) {
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.