IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How to send PDF file to TN Partner over AS2 via HTTP

webMethods Community Member

webMethods Community MemberMon December 08, 2014 12:37 PM

  • 1.  How to send PDF file to TN Partner over AS2 via HTTP

    Posted Thu August 25, 2011 08:09 AM

    Hi Experts,

    We are having a requirement in which we have to send a PDF file over AS2 via HTTP request.

    I have already achieved to send CSV/XML file via EDIINT:send service but PDF cannot be implemented same way.

    I am currently trying with MIME Object creation but no success yet.
    I am not aware how to implement MIME objects in webMethods.

    Has anyone of you implemented this thing ever before.

    Please update. its a bit urgent.

    Thanks in Advance
    Amit


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 2.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Thu August 25, 2011 02:39 PM

    Nope…but you try setting content type as Application/Octect-Stream or Application/pdf and send it?

    HTH,
    RMG


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 3.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Thu August 25, 2011 06:13 PM

    you can call service: wm.EDIINT:send to send pdf in as2
    there is
    data
    contentType ← you can populate this with application/pdf
    stream ← put your pdf as stream type here


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 4.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Fri August 26, 2011 07:29 AM

    Thanks RMG and tongwang for such a precise and quick reply.

    I am now able to send the PDF as a stream to partner but I am not sure whether the stream data that I am sending is correct or not.

    Is there a way to convert the stream contents available in PAyload back to PDF to verify partner will also receive the same PDF or not.

    Please refer the stream data in attached file.

    Really appreciate your help guys.

    Thanks,
    Amit
    streamData.txt (6.86 KB)


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Fri August 26, 2011 03:58 PM

    Streamdata cannot be readable…

    Or you can send EDIINT:send to another internal dev/qa system and test that end if you receive that payload…How are you persisting this document in TN?

    ok try that stream data send to smtp attachment and content type application/pdf…

    HTH,
    RMG


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 6.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon August 29, 2011 01:06 PM

    Thanks RMG.

    I have tried to do smtp and provided content type as application/pdf but pdf that is getting is generated is not having any data in it.

    I have even tried to make a WORD document but is ask for encoding to be used. It shows the data that I have attached as stream.txt in mny last reply.

    thanks,
    Amit


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 7.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon August 29, 2011 02:30 PM

    Also then try with application/octect-stream

    If not may be try with mime types/objects…

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 8.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Tue August 30, 2011 10:50 AM

    Sorry rmg… but this also didn’t wroked out …

    Can you try this in your system ?.. Could be possible i m making a mistake…


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Tue August 30, 2011 01:29 PM

    Finally Sorted it out…

    By setting the encoding type to “uuencode” , I was able to generate the PDF successfully.

    So I just need to inform the trading partner about this encoding type and they will be able to re generate the PDF at their end.

    Thanks RMG for your help.
    Much appreciated. :slight_smile:

    Amit.


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 10.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Tue August 30, 2011 02:52 PM

    Glad you got it resolved:


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 11.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon September 05, 2011 08:10 AM

    Hi experts,

    Got stuck in one more issue while sending PDF file over AS2 via http.

    Trading partner is getting filename as “smime.p7m”.
    I need to provide the orginal filename into this filename variable.

    Current situation:
    "content-disposition = attachment; filename=smime.p7m

    What I need:
    content-disposition = attachment; filename=INV_110829_00000004.csv

    I am able to send another parameter like “filename1” in EDIINT Data header but trading partner functionality is only recognizing filename present in content-disposition only.

    Is there any way to provide custom filename to filename present in content-disposition?

    EDIINT Data:
    Disposition-notification-to: *****
    Disposition-notification-options: signed-receipt-protocol=optional, pkcs7-signature; signed-receipt-micalg=optional, sha1
    AS2-From: ****
    AS2-To: b2b
    AS2-Version: 1.1
    filename1: INV_110829_00000004.csv
    Content-Type: application/pkcs7-mime; name=smime.p7m; smime-type=enveloped-data
    Content-Disposition: attachment; filename=smime.p7m

    Thanks,
    Amit


    #Integration-Server-and-ESB
    #B2B-Integration
    #webMethods


  • 12.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon September 05, 2011 12:21 PM

    Resolved it myself…

    WE need to manually set the content-disposition value in MIME Header before hand.
    This variable gets created at runtime ,so you need to create this variable in mime header and assign any value that you want to display.

    Thanks,
    amit


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 13.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Tue October 02, 2012 11:20 PM

    Hi Amit,
    Could you please let us know how you resolved in changing the Content-Disposition filename?

    Thanks,
    Vijay


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 14.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Wed October 03, 2012 12:08 PM

    Hi Vijay,

    You need to customize EDIINT:send service to have your own “Content-disposition”.

    1. Open and lock EDIINT:send service …
    2. Go to “wm.EDIINT.util.mime:getStreamMimeHeader” service in Sequence “Prepare to Submit”.
    3. In pipeline out there is a document named “mimeHeader”. Add a new field “Content-disposition” inside that document and map it to your desired filename.
    4. Run it and you can see customized filename in TN transaction.

    I hope this helps.
    Amit


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 15.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Wed October 03, 2012 02:40 PM

    fyi…you shouldn’t be customizing/edit the proprietary built in flows out of box packages provided and also this is not supported by SAG/advises customers unless you deal with at your own risk.

    I understand some times tweaks are needed but:

    HTH,
    RMG


    #webMethods
    #B2B-Integration
    #Integration-Server-and-ESB


  • 16.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Thu October 04, 2012 06:15 AM

    Hi Vijay,

    I forgot to mention one thing.
    You need to create a copy of EDIINT:send service in your own package and rename it to something like EDIINT:customSend and make changes in that service only.
    As suggested by RMG, SAG will not support any customization done to built in packages.

    Regards,
    Amit


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB


  • 17.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Thu October 04, 2012 02:48 PM


  • 18.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon December 08, 2014 10:56 AM

    Hi All,

    Did someone process and extracted encrypted PDF coming in from partner and generated a PDF file with all the data correctly.
    Urgent help required, any help is appreciated.

    Thanks,
    Nitin


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods


  • 19.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon December 08, 2014 12:14 PM

    Please check this thread and may be you need to use fop libraries handling pdf’s and base64 encode/decode
    for handling application/pdf depends on what version of IS 8.x or 9.x or so.

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #B2B-Integration


  • 20.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon December 08, 2014 12:18 PM

    Thanks RMG for the suggestion.
    Sorted it out, use the stream generated after the bytes segregation(in the inbuilt Processmsg service) of the part and then channeling it to the folder location.


    #Integration-Server-and-ESB
    #webMethods
    #B2B-Integration


  • 21.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Mon December 08, 2014 12:37 PM


  • 22.  RE: How to send PDF file to TN Partner over AS2 via HTTP

    Posted Fri February 06, 2015 09:31 AM

    hi,

    I have a requirement of taking in zipped payloads and extracting the content files.
    I tried putting the compression as True and then tried to extract the bytes from the stream.
    But still i am unable to generate the zip files. I am trying to decompress the bytes using the java code:

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    Object compressedData = IDataUtil.getObjectArray( pipelineCursor, “compressedData” );
    pipelineCursor.destroy();

    // byte compressedData = null;
    Inflater decompressor = new Inflater();
    decompressor.setInput(compressedData);
    ByteArrayOutputStream bos = new ByteArrayOutputStream(compressedData.length);
    byte buf = new byte[1024];
    while (!decompressor.finished()) {
    int count = decompressor.inflate(buf);
    bos.write(buf, 0, count);

    }
    bos.close();
    byte[] decompressedData = bos.toByteArray();
    

    // pipeline
    IDataCursor pipelineCursor_1 = pipeline.getCursor();
    Object outFiles = new Object[1];
    outFiles[0] = new Object();
    IDataUtil.put( pipelineCursor_1, “outFiles”, outFiles );
    pipelineCursor_1.destroy();

    Please suggest.


    #B2B-Integration
    #Integration-Server-and-ESB
    #webMethods