Package org.codehaus.xfire.attachments

Examples of org.codehaus.xfire.attachments.Attachments


            postMethod.setRequestHeader("SOAPAction", getQuotedSoapAction());
        }
       
        OutMessage message = getMessage();
        boolean mtomEnabled = Boolean.valueOf((String) context.getContextualProperty(SoapConstants.MTOM_ENABLED)).booleanValue();
        Attachments atts = message.getAttachments();
       
        if (mtomEnabled || atts != null)
        {
            if (atts == null)
            {
                atts = new JavaMailAttachments();
                message.setAttachments(atts);
            }
           
            source = new OutMessageDataSource(context, message);
            DataHandler soapHandler = new DataHandler(source);
            atts.setSoapContentType(HttpChannel.getSoapMimeType(message, false));
            atts.setSoapMessage(new SimpleAttachment(source.getName(), soapHandler));
           
            postMethod.setRequestHeader("Content-Type", atts.getContentType());
        }
        else
        {
            postMethod.setRequestHeader("Content-Type", HttpChannel.getSoapMimeType(getMessage(), true));
        }
View Full Code Here


        if (isGzipRequestEnabled(context))
        {
            os = new GZIPOutputStream(os);
        }
       
        Attachments atts = message.getAttachments();
        if (atts != null)
        {
            atts.write(os);
        }
        else
        {
            HttpChannel.writeWithoutAttachments(context, message, os);
        }
View Full Code Here

            in = new GZIPInputStream(in);
        }
       
        if (ct.toLowerCase().indexOf("multipart/related") != -1)
        {
            Attachments atts = new StreamedAttachments(getMessageContext(),in, ct);

            msgIs = atts.getSoapMessage().getDataHandler().getInputStream();
           
            InMessage msg = new InMessage(STAXUtils.createXMLStreamReader(msgIs, getEncoding(),getMessageContext()), getUri());
            msg.setAttachments(atts);
            return msg;
        }
View Full Code Here

          // Nasty Hack to workaraound bug with lowercasing contenttype by some serwers what cause problems with finding message parts.
          // There should be better fix for this.
          String ct = request.getContentType().replaceAll("--=_part_","--=_Part_");
         
         
            Attachments atts = new StreamedAttachments(context,request.getInputStream(), ct);
         
            String encoding = getEncoding(atts.getSoapContentType());

            XMLStreamReader reader =
                STAXUtils.createXMLStreamReader(atts.getSoapMessage().getDataHandler().getInputStream(),
                                                encoding,
                                                context);
            InMessage message = new InMessage(reader, request.getRequestURI());
            message.setProperty(SoapConstants.SOAP_ACTION, soapAction);
            message.setAttachments(atts);
View Full Code Here

        try
        {
            OutputStream out = null;
           
            boolean mtomEnabled = Boolean.valueOf((String) context.getContextualProperty(SoapConstants.MTOM_ENABLED)).booleanValue();
            Attachments atts = message.getAttachments();
            if (mtomEnabled || atts != null)
            {
                if (atts == null)
                {
                    atts = new JavaMailAttachments();
                    message.setAttachments(atts);
                }
               
                OutMessageDataSource source = new OutMessageDataSource(context, message);
                DataHandler soapHandler = new DataHandler(source);
                atts.setSoapContentType(HttpChannel.getSoapMimeType(message, false));
                atts.setSoapMessage(new SimpleAttachment(source.getName(), soapHandler));
   
                response.setContentType(atts.getContentType());
               
                out = new BufferedOutputStream(response.getOutputStream());
                atts.write(out);
               
                source.dispose();
            }
            else
            {
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.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.