Package org.apache.axis.attachments

Examples of org.apache.axis.attachments.Attachments


                          Object value, SerializationContext context)
        throws IOException
    {
        DataHandler dh= (DataHandler)value;
        //Add the attachment content to the message.
        Attachments attachments= context.getCurrentMessage().getAttachmentsImpl();

        if (attachments == null) {
            // Attachments apparently aren't supported.
            // Instead of throwing NullPointerException like
            // we used to do, throw something meaningful.
            throw new IOException(Messages.getMessage("noAttachments"));
        }

        Part attachmentPart= attachments.createAttachmentPart(dh);

        AttributesImpl attrs = new AttributesImpl();
        if (attributes != null && 0 < attributes.getLength())
            attrs.setAttributes(attributes); //copy the existing ones.
View Full Code Here


        }

        Message msg= getCurrentMessage();
        if(null != msg){
            //Get attachments. returns null if no attachment support.
            Attachments attachments= getCurrentMessage().getAttachmentsImpl();

            if( null != attachments && attachments.isAttachment(value)){
                //Attachment support and this is an object that should be treated as an attachment.

                //Allow an the attachment to do its own serialization.
                serializeActual(elemQName, attributes, value,
                                xmlType, sendType);
View Full Code Here

                          Object value, SerializationContext context)
        throws IOException
    {
        DataHandler dh= (DataHandler)value;
        //Add the attachment content to the message.
        Attachments attachments= context.getCurrentMessage().getAttachmentsImpl();

        if (attachments == null) {
            // Attachments apparently aren't supported.
            // Instead of throwing NullPointerException like
            // we used to do, throw something meaningful.
            throw new IOException(Messages.getMessage("noAttachments"));
        }

        Part attachmentPart= attachments.createAttachmentPart(dh);

        AttributesImpl attrs = new AttributesImpl();
        if (attributes != null && 0 < attributes.getLength())
            attrs.setAttributes(attributes); //copy the existing ones.
View Full Code Here

            }
            if( null == ret && !href.startsWith("#")){
                //Could this be an attachment?
                Message msg= null;
                if(null != (msg=msgContext.getCurrentMessage())){
                    Attachments attch= null;
                    if( null != (attch= msg.getAttachmentsImpl())){
                        try{
                        ret= attch.getAttachmentByReference(href);
                        }catch(AxisFault e){
                            throw new RuntimeException(e.toString() + JavaUtils.stackToString(e));
                        }
                    }
                }
View Full Code Here

        }

        Message msg= getCurrentMessage();
        if(null != msg){
            //Get attachments. returns null if no attachment support.
            Attachments attachments= getCurrentMessage().getAttachmentsImpl();

            if( null != attachments && attachments.isAttachment(value)){
                //Attachment support and this is an object that should be treated as an attachment.

                //Allow an the attachment to do its own serialization.
                serializeActual(elemQName, attributes, value,
                                xmlType, sendType);
View Full Code Here

          //if we have received attachments of a particular type
          // than that should be the default type to send.
          Message reqMsg= getRequestMessage();
          if( null != reqMsg){
            Attachments reqAttch= reqMsg.getAttachmentsImpl();
            Attachments respAttch= respMsg.getAttachmentsImpl();
            if(null != reqAttch  && null != respAttch){
              if(respAttch.getSendType() == Attachments.SEND_TYPE_NOTSET)
                respAttch.setSendType(reqAttch.getSendType());//only if not explicity set.
            }
          }
        }
    }
View Full Code Here

        }

        Message msg= getCurrentMessage();
        if(null != msg){
            //Get attachments. returns null if no attachment support.
            Attachments attachments= getCurrentMessage().getAttachmentsImpl();

            if( null != attachments && attachments.isAttachment(value)){
                //Attachment support and this is an object that should be treated as an attachment.

                //Allow an the attachment to do its own serialization.
                serializeActual(elemQName, attributes, value,
                                xmlType, sendType);
View Full Code Here

          //if we have received attachments of a particular type
          // than that should be the default type to send.
          Message reqMsg= getRequestMessage();
          if( null != reqMsg){
            Attachments reqAttch= reqMsg.getAttachmentsImpl();
            Attachments respAttch= respMsg.getAttachmentsImpl();
            if(null != reqAttch  && null != respAttch){
              if(respAttch.getSendType() == Attachments.SEND_TYPE_NOTSET)
                respAttch.setSendType(reqAttch.getSendType());//only if not explicity set.
            }
          }
        }
    }
View Full Code Here

        }

        Message msg= getCurrentMessage();
        if(null != msg){
            //Get attachments. returns null if no attachment support.
            Attachments attachments= getCurrentMessage().getAttachmentsImpl();

            if( null != attachments && attachments.isAttachment(value)){
                //Attachment support and this is an object that should be treated as an attachment.

                //Allow an the attachment to do its own serialization.
                serializeActual(elemQName, attributes, value,
                                xmlType, sendType);
View Full Code Here

            }
            if( null == ret && !href.startsWith("#")){
                //Could this be an attachment?
                Message msg= null;
                if(null != (msg=msgContext.getCurrentMessage())){
                    Attachments attch= null;
                    if( null != (attch= msg.getAttachmentsImpl())){
                        try{
                        ret= attch.getAttachmentByReference(href);
                        }catch(AxisFault e){
                            throw new RuntimeException(e.toString() + JavaUtils.stackToString(e));
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.axis.attachments.Attachments

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.