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

B2B FTP Listner - unable to do ftp put

  • 1.  B2B FTP Listner - unable to do ftp put

    Posted Wed May 01, 2002 09:59 AM

    I am using this peice of code to handle unrecognized content type. This works fine when I ftp any file with .txt extension, but if i use any other extension say .edi or .datetimestamp, the ftp put fails.

    ftp> put ediorder.edi
    200 PORT command successful.
    553 ‘ediorder.edi’: cannot write.

    ftp> put ediorder.txt
    200 PORT command successful.
    150 Binary mode data connection for ediorder.txt
    226 Binary transfer complete.
    local: ediorder.txt remote: ediorder.txt
    542 bytes sent in 0.014 seconds (37.90 Kbytes/s)

    //System.out.println(“contentstream NOT NULL… ==>> unrecognized content type…”);
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    byte buf = new byte[1024];
    int read = is.read(buf);
    int counter = 0;
    while (read >= 0) {
    counter += read;
    bos.write(buf, 0, read);
    read = is.read(buf);
    }
    out.put(“textData”,new String(bos.toByteArray()));
    //System.out.println(out);

    any help in this regards is helpful.
    Thanks,
    Saurabh
    sm195@lucent.com
    973-386-6850


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 2.  RE: B2B FTP Listner - unable to do ftp put

    Posted Thu May 02, 2002 10:47 AM

    A ContentHandler is selected using the mime type of the incoming data. In the case of FTP Listener the mime type is determined from the extension of the file, in your case “txt”. There is a mime.types file in the server/lib directory that contains the mappings of extension to mime type.

    Add your new file extensions to the text mime type.


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods