Examples of AttachmentPartImpl


Examples of com.sun.xml.internal.messaging.saaj.soap.AttachmentPartImpl

        }

        List<MIMEPart> prts = mm.getAttachments();
        for(MIMEPart part : prts) {
            if (part != soapPart) {
                AttachmentPart attach = new AttachmentPartImpl(part);
                this.addBodyPart(new MimeBodyPart(part));
            }
       }
       parsed = true;
    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.AttachmentPartImpl

        }

        List<MIMEPart> prts = mm.getAttachments();
        for(MIMEPart part : prts) {
            if (part != soapPart) {
                AttachmentPart attach = new AttachmentPartImpl(part);
                this.addBodyPart(new MimeBodyPart(part));
            }
       }
       parsed = true;
    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.AttachmentPartImpl

        }

        List<MIMEPart> prts = mm.getAttachments();
        for(MIMEPart part : prts) {
            if (part != soapPart) {
                new AttachmentPartImpl(part);
                this.addBodyPart(new MimeBodyPart(part));
            }
       }
       parsed = true;
    }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

      return null;
   }

   public AttachmentPart createAttachmentPart()
   {
      return new AttachmentPartImpl();
   }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

   private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value, CIDGenerator cidGenerator) throws SOAPException, BindingException
   {
      String partName = paramMetaData.getXmlName().getLocalPart();
      Set mimeTypes = paramMetaData.getMimeTypes();

      AttachmentPart part = new AttachmentPartImpl();
      if (value instanceof DataHandler)
      {
         DataHandler handler = (DataHandler)value;
         String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());

         // JAX-WS 2.0, 2.6.3.1 MIME Content
         // Conformance (MIME type mismatch): On receipt of a message where the MIME type of a part does not
         // match that described in the WSDL an implementation SHOULD throw a WebServiceException.
         if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
            log.warn("Mime type " + mimeType + " not allowed for parameter " + partName + " allowed types are " + mimeTypes);

         part.setDataHandler((DataHandler)value);
      }
      else
      {
         String mimeType = null;
         if (mimeTypes != null && mimeTypes.size() > 0)
         {
            mimeType = (String)mimeTypes.iterator().next();
         }
         else
         {
            mimeType = MimeUtils.resolveMimeType(value);
         }

         if (mimeType == null)
            throw new BindingException("Could not determine mime type for attachment parameter: " + partName);

         part.setContent(value, mimeType);
      }

      if (paramMetaData.isSwA())
      {
         String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
         part.setContentId(swaCID);
      }
      if (paramMetaData.isXOP())
      {
         String xopCID = '<' + cidGenerator.generateFromName(partName) + '>';
         part.setContentId(xopCID);
      }

      return part;
   }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

   private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value, CIDGenerator cidGenerator) throws SOAPException, BindingException
   {
      String partName = paramMetaData.getXmlName().getLocalPart();
      Set mimeTypes = paramMetaData.getMimeTypes();

      AttachmentPart part = new AttachmentPartImpl();
      if (value instanceof DataHandler)
      {
         DataHandler handler = (DataHandler)value;
         String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());

         // JAX-WS 2.0, 2.6.3.1 MIME Content
         // Conformance (MIME type mismatch): On receipt of a message where the MIME type of a part does not
         // match that described in the WSDL an implementation SHOULD throw a WebServiceException.
         if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
            log.warn("Mime type " + mimeType + " not allowed for parameter " + partName + " allowed types are " + mimeTypes);

         part.setDataHandler((DataHandler)value);
      }
      else
      {
         String mimeType = null;
         if (mimeTypes != null && mimeTypes.size() > 0)
         {
            mimeType = (String)mimeTypes.iterator().next();
         }
         else
         {
            mimeType = MimeUtils.resolveMimeType(value);
         }

         if (mimeType == null)
            throw new BindingException("Could not determine mime type for attachment parameter: " + partName);

         part.setContent(value, mimeType);
      }

      if (paramMetaData.isSwA())
      {
         String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
         part.setContentId(swaCID);
      }
      if (paramMetaData.isXOP())
      {
         String xopCID = '<' + cidGenerator.generateFromName(partName) + '>';
         part.setContentId(xopCID);
      }

      return part;
   }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

      return null;
   }

   public AttachmentPart createAttachmentPart()
   {
      return new AttachmentPartImpl();
   }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

      return null;
   }

   public AttachmentPart createAttachmentPart()
   {
      return new AttachmentPartImpl();
   }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

   private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value, CIDGenerator cidGenerator) throws SOAPException, BindingException
   {
      String partName = paramMetaData.getXmlName().getLocalPart();
      Set mimeTypes = paramMetaData.getMimeTypes();

      AttachmentPart part = new AttachmentPartImpl();
      if (value instanceof DataHandler)
      {
         DataHandler handler = (DataHandler)value;
         String mimeType = MimeUtils.getBaseMimeType(handler.getContentType());

         // JAX-WS 2.0, 2.6.3.1 MIME Content
         // Conformance (MIME type mismatch): On receipt of a message where the MIME type of a part does not
         // match that described in the WSDL an implementation SHOULD throw a WebServiceException.
         if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
            log.warn("Mime type " + mimeType + " not allowed for parameter " + partName + " allowed types are " + mimeTypes);

         part.setDataHandler((DataHandler)value);
      }
      else
      {
         String mimeType = null;
         if (mimeTypes != null && mimeTypes.size() > 0)
         {
            mimeType = (String)mimeTypes.iterator().next();
         }
         else
         {
            mimeType = MimeUtils.resolveMimeType(value);
         }

         if (mimeType == null)
            throw new BindingException("Could not determine mime type for attachment parameter: " + partName);

         part.setContent(value, mimeType);
      }

      if (paramMetaData.isSwA())
      {
         String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
         part.setContentId(swaCID);
      }
      if (paramMetaData.isXOP())
      {
         String xopCID = '<' + cidGenerator.generateFromName(partName) + '>';
         part.setContentId(xopCID);
      }

      return part;
   }
View Full Code Here

Examples of org.jboss.ws.core.soap.attachment.AttachmentPartImpl

      return null;
   }

   public AttachmentPart createAttachmentPart()
   {
      return new AttachmentPartImpl();
   }
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.