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

Download file from IS to MWS

webMethods Community Member

webMethods Community MemberThu April 30, 2015 12:48 PM

  • 1.  Download file from IS to MWS

    Posted Mon April 27, 2015 07:34 PM

    Hello,

    I’m trying to show a file in MWS that I created on IS.

    First, I use stringToBytes and than use base64Encode (print 1)

    In MWS, on my button action, I set this java code (print 2)

    Now, I getting this error when i execute (print 3)

    Please, can anyone help me?

    Thanks!


    print 3.png


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 2.  RE: Download file from IS to MWS

    Posted Tue April 28, 2015 02:49 AM

    Hey, the content type appears wrong, spelling mistake… Please retry after correcting it.


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 3.  RE: Download file from IS to MWS

    Posted Tue April 28, 2015 09:58 AM

    Hello Raja,

    I’ve fixed this mistake, but still the same error. Tried to add “charset=UTF-8” in content type, but not working.

    Some examples used in content type:
    String contentType = “application/csv”;
    String contentType = “text/csv”;
    String contentType = “text/plain”;

    Thanks!


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 4.  RE: Download file from IS to MWS

    Posted Tue April 28, 2015 10:59 AM

    I think is something with WSDL, or not?. (print 4)

    print4.png


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 5.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 11:12 AM

    Hello,

    I found a solution, i set an output flow service as string instead of object, so my WSDL changes to string type.

    Well, now I have a csv file when I click in a button, but all buttons form are disabled at this moment.

    I added a script block with this code:

    Event.observe( window, 'load', function() {  
    CAF.model('#{activePageBean.clientIds['buttonRelatorio']}').addActionListener(function(id) {Form.enableButtons(document.body);
    });  
    });

    But nothing happens, the buttons remain disabled.

    Can anyone help me?

    Thanks!


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 6.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 12:00 PM

    Hello Luis Henrique,

    Please find the attached document. This document is helpful to your scenario.

    Thanks & Regards,
    Prem Sai.
    HowToUploadDownloadFiles_MWS-IS.pdf (439 KB)


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 7.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 12:12 PM

    Hello Prem Sai,

    Thanks for reply.

    This part it’s working, getting the file from IS and show for client in MWS.
    But in this moment, all buttons in my form gets disabled and even with an action listener to enable the buttons, it’s doesn’t work.

    This document shows only how to download from IS to MWS.

    Thanks!


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 8.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 12:24 PM

    Hello Luis Henrique,

    once please change the auto refresh property to true in your portlet.

    Thanks & Regards,
    Prem sai.


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 9.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 12:48 PM


  • 10.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 01:03 PM

    Changed form properties “Target” to _self

    Working now! :lol:

    Thanks!


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 11.  RE: Download file from IS to MWS

    Posted Thu April 30, 2015 01:06 PM

    Great Luis Henrique.

    Thanks,
    Prem


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 12.  RE: Download file from IS to MWS

    Posted Fri May 01, 2015 08:24 AM

    Hello Luis ,

    What is the IS version you are using.

    Previously I have designed some file upload/download in CAF and was working in 8.2…but now when I ma trying to use same design in 9.7 It is not working.
    For upload file mapping (mapping is done using java custom code) to objectType for input is not working.

    Thanks


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 13.  RE: Download file from IS to MWS

    Posted Sat May 02, 2015 02:28 PM

    Baharul,

    Try setting your input flow service as object and java wrapper type properties to “byte

    I’m using 9.5.1

    Let me know if works!

    Thanks!


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 14.  RE: Download file from IS to MWS

    Posted Sun May 03, 2015 08:52 AM

    Hi Luis,
    After setting java wrapper type to byte,I am able to invoke webService and transfer encoded data file to IS.
    But this is working only for text type document.For others document type getting errors of timeout(maximum time as well as encoding error in some scenario).
    I have used “save pipeline to file” to file in IS flow service and what have noticed is that .if document selected is not text type then the size of the saved file is getting 2mb while selecting a file of 100KB.
    I have used the below code sample for getting the file from fileItem and mapped to IS input.

    getInsertFile2().getParameters().getInsertFile().getInputDoc().setUploadedFile(getFileItem().get());

    Thanks
    Baharul Islam


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 15.  RE: Download file from IS to MWS

    Posted Sun June 07, 2015 11:08 AM

    Hi Luis,
    I have tried the below code in 9.8 but not working

    After getting byte data from CAF in flow service below step I have used to insert data in oracle database…

    pub.string:bytesToString
    pub.string:base64Decode
    pub.io:bytesToStream
    Insert adapter to insert as CLOB Data

    To get back the file in UI,flow service step written as

    Select adapter to get the CLOB Data
    pub.io:streamToBytes
    pub.string:base64Encode
    pub.string:stringToBytes

    In this step I am able to insert the data in DB ,but at the time of displaying not getting any data in output.
    Can any one please help to get the appropriate step need to follow to display the file in CAF UI.

    Thanks
    Baharul


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 16.  RE: Download file from IS to MWS

    Posted Mon June 08, 2015 10:14 AM

    Hello Baharul,

    Try to use base64Encode output as your flow service output.

    In your CAF page, you’ll need to add an action with a java code (print 2 in my first post).

    Thanks.


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS