Examples of EbMSAttachment


Examples of nl.clockwork.mule.ebms.model.EbMSAttachment

  public static EbMSMessageContent EbMSMessageToEbMSMessageContent(EbMSMessage message) throws IOException
  {
    List<EbMSAttachment> attachments = new ArrayList<EbMSAttachment>();
    for (DataSource attachment : message.getAttachments())
      attachments.add(new EbMSAttachment(attachment.getName(),attachment.getContentType(),IOUtils.toByteArray(attachment.getInputStream())));

    return new EbMSMessageContent(new EbMSMessageContext(message.getMessageHeader()),attachments);
  }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.EbMSAttachment

    if (message.getPayload() instanceof EbMSMessageContent)
    {
      try
      {
        EbMSMessageContent content = (EbMSMessageContent)message.getPayload();
        EbMSAttachment attachment = content.getAttachments().iterator().next();
        AanleverBericht aanleverBericht = XMLMessageBuilder.getInstance(AanleverBericht.class).handle(new String(attachment.getContent()));
        return berichtSoort.equalsIgnoreCase(aanleverBericht.getBerichtsoort());
      }
      catch (Exception e)
      {
        logger.error(e);
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.EbMSAttachment

        afleverBevestiging.setTijdstempelAfgeleverd(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
      else
        afleverBevestiging.setFout(error);

      List<EbMSAttachment> attachments = new ArrayList<EbMSAttachment>();
      attachments.add(new EbMSAttachment(name,"application/xml",XMLMessageBuilder.getInstance(BevestigAfleverBericht.class).handle(afleverBevestiging).getBytes()));

      return new EbMSMessageContent(new EbMSMessageContext(cpaId,service,action,content.getContext().getConversationId()),attachments);
    }
    catch (Exception e)
    {
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.EbMSAttachment

    if (message.getPayload() instanceof EbMSMessageContent)
    {
      try
      {
        EbMSMessageContent content = (EbMSMessageContent)message.getPayload();
        EbMSAttachment attachment = content.getAttachments().iterator().next();
        AfleverBericht afleverBericht = XMLMessageBuilder.getInstance(AfleverBericht.class).handle(new String(attachment.getContent()));
        return berichtSoort.equalsIgnoreCase(afleverBericht.getBerichtsoort());
      }
      catch (Exception e)
      {
        logger.error(e);
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.EbMSAttachment

        aanleverBevestiging.setTijdstempelAangeleverd(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
      else
        aanleverBevestiging.setFout(error);

      List<EbMSAttachment> attachments = new ArrayList<EbMSAttachment>();
      attachments.add(new EbMSAttachment(name,"application/xml",XMLMessageBuilder.getInstance(BevestigAanleverBericht.class).handle(aanleverBevestiging).getBytes()));

      return new EbMSMessageContent(new EbMSMessageContext(cpaId,service,action,content.getContext().getConversationId()),attachments);
    }
    catch (Exception e)
    {
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.EbMSAttachment

  public Object transform(final MuleMessage message, String outputEncoding) throws TransformerException
  {
    try
    {
      String fileName = message.getStringProperty("originalFilename","message.xml");
      EbMSAttachment attachment = new EbMSAttachment(fileName,StringUtils.defaultIfEmpty(Utils.getMimeType(fileName),"application/octet-stream"),((String)message.getPayload()).getBytes()); //application/xml
      message.setPayload(Arrays.asList(attachment));
      return message;
    }
    catch (IOException e)
    {
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.