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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

webMethods 9.9 file upload issue

  • 1.  webMethods 9.9 file upload issue

    Posted 02/19/16 08:23 AM

    Dear experts,

    i am using webMethods 9.9 and i am trying to upload a file in CAF. I created an IS service that decodes the input file and exposed it as a web service and now it is bound to the upload action button in my portlet.

    my problem is that each time i upload a file of any type (png, txt,…) i get the following exception:

    unknown type can’t serialize.

    appreciate your help.

    thanks,

    Wanis


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


  • 2.  RE: webMethods 9.9 file upload issue

    Posted 03/22/16 03:15 AM

    I am facing the same issue. I have followed all the steps shown in

    http://techcommunity.softwareag.com/web/guest/pwiki/-/wiki/Main/How+to+UploadDownload+a+File+from+MWS+To+IS

    But i m facing "Unknow type can not serialize” when i m refreshing the service.

    It is an urgent requirement, please share if anybody knows any thing about this.


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


  • 3.  RE: webMethods 9.9 file upload issue

    Posted 03/22/16 12:55 PM

    Is this working on lower versions ? Not sure as I didn’t come across.

    Thanks,


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


  • 4.  RE: webMethods 9.9 file upload issue

    Posted 03/22/16 10:57 PM

    yes,

    I have implemented this in lower versions(8.2) and it worked.


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


  • 5.  RE: webMethods 9.9 file upload issue

    Posted 03/23/16 06:37 AM

    @Manoj, i followed the same steps in the link as well and still no luck.

    please guys, help us.

    Thanks


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


  • 6.  RE: webMethods 9.9 file upload issue

    Posted 03/29/16 01:42 AM

    To resolve "Unknow type can not serialize” error. One minor change need to be done at the service input. The Input of DataType: Object should have Java Wrapper Type: byte

    Capture.JPG


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


  • 7.  RE: webMethods 9.9 file upload issue

    Posted 05/20/16 10:52 PM

    Hi,
    I am unable to to bind the input stream.

    getting following error while invoke service on IS

    Missing required value: string

    Please help how we can bind the input stream.


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


  • 8.  RE: webMethods 9.9 file upload issue

    Posted 05/21/16 02:02 PM

    Virendra,

    I hope the service Input is of DataType: Object and should have Java Wrapper Type: byte.

    Can you elaborate how are you mapping the File Item of CAF Portlet to this input of the service.

    Thanks
    Manoj


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


  • 9.  RE: webMethods 9.9 file upload issue

    Posted 05/21/16 06:00 PM

    Hi Manoj,

    I have bind the #{FileUploadDefaultviewView.fileItem.inputStream} to input service doc array.
    please refer attached screenshot.


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


  • 10.  RE: webMethods 9.9 file upload issue

    Posted 05/22/16 02:15 AM

    Virendra,

    create an new action at the binding.

    And map the file item to the input which suppose to hold the fileContent for service as:
    public String uploadAction() {
    // TODO: implement java method
    getTestUploadFile().getParameters().getTestUploadFile().getTestUploadFile().setFileContent(getFileItem().get());
    return null;
    }

    you can directly map other inputs to the service from binding.

    refresh the service from Upload Action method and map the action with async command or command button on UI.

    public String uploadAction() {
    // TODO: implement java method
    getTestUploadFile().getParameters().getTestUploadFile().getTestUploadFile().setFileContent(getFileItem().get());
    getTestUploadFile().refresh();
    return null;
    }


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


  • 11.  RE: webMethods 9.9 file upload issue

    Posted 05/22/16 12:44 PM

    hi Manoj,
    I didn’t find the methods .setFileContent() methods.

    I can see follwing only.

    getReceiveFileFormMWS3().getParameters().getReceiveFileFormMWS().getReceiveFileFormMWS().getInputDoc().setUploadedFile(getFileItem().get());

    Thanks,
    Virendra


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


  • 12.  RE: webMethods 9.9 file upload issue

    Posted 05/24/16 12:05 PM

    Hi Manoj,

    Can you please suggest how you implement the same case.


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


  • 13.  RE: webMethods 9.9 file upload issue

    Posted 05/24/16 02:09 PM

    yes, that’s right.

    Try the code which you have mentioned in your previous post.

    getReceiveFileFormMWS3().getParameters().getReceiveFileFormMWS().getReceiveFileFormMWS().getInputDoc().setUploadedFile(getFileItem().get());

    I think it should work.

    Dont get confused: Here,

    getTestUploadFile().getParameters().getTestUploadFile().getTestUploadFile().setFileContent(getFileItem().get());

    It is setFileContent(…) because fileContent is name of the input field of service.

    regards
    Manoj


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


  • 14.  RE: webMethods 9.9 file upload issue

    Posted 05/24/16 03:42 PM

    still getting same error.

    [ISS.0086.9063] Missing required value: string
    no value getting passed to IS service.

    Please help me on it. not able to figure what mistake i am doing.

    Thanks in advace.


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


  • 15.  RE: webMethods 9.9 file upload issue

    Posted 05/26/16 06:04 AM


  • 16.  RE: webMethods 9.9 file upload issue

    Posted 05/27/16 04:23 PM

    Thanks manoj for help now I am able to get byte array data on IS.

    one last I faced if i tried to upload pdf of word getting cast exception. have you tried to upload such kinds of file .


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


  • 17.  RE: webMethods 9.9 file upload issue

    Posted 06/10/16 08:09 AM

    you can try

    below steps to Upload file of various types:

    1: At IS service level, change the type of the input variable (which will hold the content) to String.

    2: Suppose the name of the service is uploadFile() and name of the input variable that will hold the contnet is fileInput

    3: getUploadFile().getParameters().getUploadFile().getUploadFile().setFileInput(encode(getFileItem().get()));

    where FileItem is (at CAF) File Input Value holder

    this encode() is :
    import com.webMethods.rtl.encode.Base64;

    public String encode(Object data) {
    if (data instanceof String) {
    return “\n” + ((String)data) + “\n”;
    }
    if (data instanceof byte) {
    byte enc = Base64.encode((byte)(byte)data);
    String s = new String(enc);
    return “\n” + s + “\n”;
    }
    return “\n” + data.toString() + “\n”;
    }

    plz tell if it works

    also let me know if you found some other way


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


  • 18.  RE: webMethods 9.9 file upload issue

    Posted 06/17/16 01:57 PM

    Thanks Manoj for help

    after changing to string and encode the at CAF it works now I am able upload any kinds of file.


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


  • 19.  RE: webMethods 9.9 file upload issue

    Posted 06/23/16 09:02 AM

    Hi all,

    changing the wrapper type from UNKNOWN to byte[] works but is probably not a practicable solution. It changes the WSDL as follows:

    <xsd:element name="uploadFile" nillable="true" type="xsd:anyType"/>

    =>

    <xsd:element maxOccurs="unbounded" name="uploadFile" nillable="true" type="xsd:byte"/>

    That means that every byte of the file is uploaded with an enclosing XML tag. This is a huge overhead.

    The better solution is to use a String with Content type base64Binary:

    <xsd:element name="uploadFile" nillable="true" type="xsd:base64Binary"/>

    The client stub will generate an interface using a javax.activation.DataHandler:

    getPublishMessage().getParameters().getPublishMessage().getPublishMessage().setMsgFile(new DataHandler(getFile().get(),"application/octet-stream"));

    Now the file is sent as a Base64 encoded string.

    Michael


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


  • 20.  RE: webMethods 9.9 file upload issue

    Posted 06/25/16 05:39 AM

    Thanks Michael for sharing the details. Indeed it will be useful to someone on some day.

    Thanks,


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


  • 21.  RE: webMethods 9.9 file upload issue

    Posted 11/02/16 06:30 PM

    Hello Manoj, I am facing the same issue with the error message: "Missing required value: string " for binary files. For simple text files I get following error message: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String.

    Can you please provide your working sample.war for portlet and IS flow?


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


  • 22.  RE: webMethods 9.9 file upload issue

    Posted 11/03/16 07:40 AM

    Hello Stenly Ristau,

    First Create a IS flow service which will receive the file from CAF as shown in the image below.


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


  • 23.  RE: webMethods 9.9 file upload issue

    Posted 11/04/16 04:55 PM

    Hello Manoj, thank you for the help. I got it now:

    public String uploadCommand() {
    getUpload().getParameters().getUpload().getUpload().setInputeFile(new DataHandler(getFileItem().get(),“application/octet-stream”));
    getUpload().refresh();
    return null;
    }


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


  • 24.  RE: webMethods 9.9 file upload issue

    Posted 11/28/16 05:33 PM

    Hello Manoj, is it possible to upload multiple files at once? Thanks Stenly


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


  • 25.  RE: webMethods 9.9 file upload issue

    Posted 11/29/16 03:49 PM

    we can not upload multiple files.


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


  • 26.  RE: webMethods 9.9 file upload issue

    Posted 03/03/17 06:24 AM

    Hi Guys,

    I had followed all mentioned steps … but i am unable to hit IS service … even no error too on screen. May i know what might be the issue.


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