webMethods

webMethods

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

Extracting payload from a InputStream

  • 1.  Extracting payload from a InputStream

    Posted Wed April 15, 2015 02:46 AM

    Hi All,

    We have a requirement where in the client will be sending an xCBL data along with a pdf attachment in one single inputStream.

    We have created SOAP UI proj and when we send the request i can the following in SOAP UI http logs:


    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Type: multipart/form-data; boundary="----=_Part_29_21165087.1429071736292"[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "MIME-Version: 1.0[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Length: 270076[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Host: gszajnb742.anglo.local:4444[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Connection: Keep-Alive[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "------=_Part_29_21165087.1429071736292"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Type: multipart/form-data"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Transfer-Encoding: 8bit"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "xCBL data here"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "------=_Part_29_21165087.1429071736292"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Type: application/pdf; name=get_page_attachment.pdf"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Transfer-Encoding: binary"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "Content-Disposition: form-data; name="get_page_attachment.pdf"; filename="get_page_attachment.pdf""
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"
    Wed Apr 15 09:52:16 IST 2015:DEBUG:>> "[\r][\n]"

    Binaries for PDF starting here…


    In the flow service i have given the input as contentStream (Object).

    Can anyone please guide me on extracting the two data type i.e. text and binary, separately.

    I have tried using the mime inbuilt flow services but of no use.

    Any help will be much appreaciated.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Extracting payload from a InputStream

    Posted Wed April 22, 2015 01:07 PM

    If this is an MTOM implementation on your client side then use the service pub.soap.utils:getXOPObjectContent to convert the incoming content to data from a base64 encoded string field.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services