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
  • 1.  HTTP - File content as Stream

    Posted Fri November 15, 2013 02:51 PM

    Hi,
    I’ve a scenario where I need to send file content as stream and an IS document together as inputs to another service over http.

    What is the best way to achieve this in webMethods.

    Please note that the target service is also an webMethods flow service.


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: HTTP - File content as Stream

    Posted Fri November 15, 2013 04:32 PM

    use the service: pub.client:http to post, you can populate either: data/stream
    or: data/mimeStream
    with a stream object
    also set:
    Content-Type=application/octet-stream
    under headers

    on the receiver side, you will have a Stream object with name:
    contentStream


    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: HTTP - File content as Stream

    Posted Mon November 18, 2013 10:01 PM

    Yes try with the contentStream object and make sure the content-type also set to appropriate one like application/octect-stream etc…


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 4.  RE: HTTP - File content as Stream

    Posted Thu November 21, 2013 01:56 PM

    It worked after setting the Content-type to octet-stream, previously I had it as multipart/mixed.
    However, I have an issue while extracting the content of the mime message. On the sender side, I’m adding two body parts. File Content and XML data but on the receiver end when I used getNumParts service, it just shows me 1.

    The sender has following steps to build the mime message

    1. createMimeData
    2. convert xml string to stream
    3. addBodyPart (content as above stream, contentype as text/plain)
    4. Read file as Stream
    5. addBodyPart ( content as above stream, contentype as text/plain)
    6. getEnvelopeStream - createMultipart to yes
    7. call http (data/mimeStream as above stream, method - post, Content-type - application/octet-stream

    Receiver has createMimeData to create mime object out of contentStream and invoke getNumParts to get a list of parts


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 5.  RE: HTTP - File content as Stream

    Posted Thu November 21, 2013 04:23 PM

    I’ve installed the WmSamples package and added pub.client:http service with the url and it does not work as the number of parts is returning me just 1 :slight_smile:

    Any idea, why the mime message just has one part instead of all the parts we add ?


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 6.  RE: HTTP - File content as Stream

    Posted Fri November 22, 2013 12:16 PM

    I tried all the options I could think of but could not get the mime part working as it all the time gives me that the message has only one parts.

    Can I send the variables in the args and send the file content as stream in the http call ?
    Is it a good idea or can I use http headers to go around this problem ??


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 7.  RE: HTTP - File content as Stream

    Posted Wed November 27, 2013 03:44 AM

    Yes you can in deed send vars in args and stream content (with appropriate content-type) in the http call and make sure the end point also accept the args.

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport