Examples of AttachmentDescription


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

            // Get the return value.
            Class returnType = operationDesc.getResultActualType();
            Object returnValue = null;
            boolean hasReturnInBody = false;
            if (returnType != void.class) {
                AttachmentDescription attachmentDesc =
                    operationDesc.getResultAttachmentDescription();
                if (attachmentDesc != null) {
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                       String cid = message.getAttachmentID(0);
                       returnValue = message.getDataHandler(cid);
                    } else {
                        throw ExceptionFactory.
                          makeWebServiceException(Messages.getMessage("pdElementErr"));
View Full Code Here

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

            Message m = mf.create(protocol);

            // Put the return object onto the message
            Class returnType = operationDesc.getResultActualType();
            if (returnType != void.class) {
                AttachmentDescription attachmentDesc =
                    operationDesc.getResultAttachmentDescription();
                if (attachmentDesc != null) {
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                        // Create an Attachment object with the signature value
                        Attachment attachment = new Attachment(returnObject,
                                                               returnType,
                                                               attachmentDesc,
                                                               operationDesc.getResultPartName());
View Full Code Here

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

                returnLocalPart = operationDesc.getResultPartName();
            }

            if (returnType != void.class) {

                AttachmentDescription attachmentDesc =
                    operationDesc.getResultAttachmentDescription();
                if (attachmentDesc != null) {
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                        // Create an Attachment object with the signature value
                        Attachment attachment = new Attachment(returnObject,
                                                               returnType,
                                                               attachmentDesc,
                                                               operationDesc.getResultPartName());
View Full Code Here

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

            // Get the return value.
            Class returnType = operationDesc.getResultActualType();
            Object returnValue = null;
            boolean hasReturnInBody = false;
            if (returnType != void.class) {
                AttachmentDescription attachmentDesc =
                    operationDesc.getResultAttachmentDescription();
                if (attachmentDesc != null) {
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                       String cid = message.getAttachmentID(0);
                       returnValue = message.getDataHandler(cid);
                       if (ConvertUtils.isConvertable(returnValue, returnType)) {
                           returnValue = ConvertUtils.convert(returnValue, returnType);
                       }
View Full Code Here

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

            // Get the return value.
            Class returnType = operationDesc.getResultActualType();
            Object returnValue = null;
            boolean hasReturnInBody = false;
            if (returnType != void.class) {
                AttachmentDescription attachmentDesc =
                    operationDesc.getResultAttachmentDescription();
                if (attachmentDesc != null) {
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                       String cid = message.getAttachmentID(0);
                       returnValue = message.getDataHandler(cid);
                    } else {
                        throw ExceptionFactory.
                          makeWebServiceException(Messages.getMessage("pdElementErr"));
View Full Code Here

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

            // Put the return object onto the message
            Class returnType = operationDesc.getResultActualType();
            if (returnType != void.class) {
               
                AttachmentDescription attachmentDesc =
                    operationDesc.getResultAttachmentDescription();
                if (attachmentDesc != null) {
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                        // Create an Attachment object with the signature value
                        Attachment attachment = new Attachment(returnObject,
                                                               returnType,
                                                               attachmentDesc,
                                                               operationDesc.getResultPartName());
View Full Code Here

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

                //}

                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);
                        }
View Full Code Here

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

                    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()) {
View Full Code Here

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

        if (log.isDebugEnabled()) {
            log.debug("Creating a PDElement for an attachment value: " +
                      ((value == null)? "null":value.getClass().getName()));
            log.debug("ParameterDescription = " + pd.toString());
        }
        AttachmentDescription attachmentDesc = pd.getAttachmentDescription();
       
        AttachmentType attachmentType = attachmentDesc.getAttachmentType();
        if (attachmentType == AttachmentType.SWA) {
            // Create an Attachment object with the signature value
            Attachment attachment = new Attachment(value,
                                                   formalType,
                                                   attachmentDesc,
View Full Code Here

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

                //}

                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());
                    }

                    boolean consume = true;
                    // 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);
                        consume = false;
                    } else {
                        if (totalBodyBlocks > 1) {
                            // You must use this method if there are more than one body block
                            // This method may cause OM expansion
                            block = message.getBodyBlock(index, context, factory);
                        } else {
                            // Use this method if you know there is only one body block.
                            // This method prevents OM expansion.
                            block = message.getBodyBlock(context, factory);
                        }
                        index++;
                    }
                   
                    Element element;
                    if (block != null) {
                        element = new Element(block.getBusinessObject(true),
                                              block.getQName());
                    } else {
                        // The block could be null if the header is missing (which is allowed)
                        QName qName = new QName(pd.getTargetNamespace(),pd.getParameterName());
                        if (log.isDebugEnabled()) {
                            log.debug("There is no value in the incoming message for " + qName);
                        }
                        element = new Element(null, qName, pd.getParameterActualType());
                    }
                    PDElement pde =
                        new PDElement(pd, element, unmarshalByJavaType == null ? null
                                : unmarshalByJavaType[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);
                        }
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.