Package org.apache.axis2.jaxws.description

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


                            if (opDesc.getPartAttachmentDescription(part) == null) {
                                if (log.isDebugEnabled()) {
                                    log.debug("Adding new AttachmentDescription for part: " + part
                                            + " on operation: " + opDesc.getOperationName());
                                }
                                AttachmentDescription attachmentDesc =
                                        new AttachmentDescriptionImpl(AttachmentType.SWA,
                                                                      new String[] { type });
                                opDesc.addPartAttachmentDescription(part, attachmentDesc);
                            } else {
                                if (log.isDebugEnabled()) {
View Full Code Here

                    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

        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

                //}

                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) {
                            // 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 = new Element(block.getBusinessObject(true),
                                                  block.getQName());
                    PDElement pde =
                        new PDElement(pd, element, unmarshalByJavaType == null ? null
                                : unmarshalByJavaType[i]);
                    pdeList.add(pde);
                } else {
                    // Attachment Processing
                    if (attachmentDesc.getAttachmentType() == AttachmentType.SWA) {
                        String cid = message.getAttachmentID(swaIndex);
                        DataHandler dh = message.getDataHandler(cid);
                        Attachment attachment = new Attachment(dh, cid);
                        PDElement pde = new PDElement(pd, null, null, attachment);
                        pdeList.add(pde);
View Full Code Here

                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

            // 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

                    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

        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

                //}

                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) {
                            // 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 = new Element(block.getBusinessObject(true),
                                                  block.getQName());
                    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

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

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.