3 Replies Latest reply: Jan 21, 2011 6:15 AM by Anuj Dwivedi--Oracle RSS

    ALSB / OSB Java callout to gunzip

      We have an input file which is in a gz format, which we need to gunzip before passing onto our business service.

      We're writing a simple Java callout component to do this - taking an input stream and returning an output stream.

      What variable should I pass into my input stream from the callout in the proxy service message flow?

      I've tried $body and $input, but neither of these work.

      Thanks in advance

      Phil Riley
        • 1. Re: ALSB / OSB Java callout to gunzip
          Anuj Dwivedi--Oracle
          Use reporting/alert/log action to check that which variable ($body or $attachments) contains the content of gunzipped file. You may refer below link to know more about context variables in OSB -


          • 2. Re: ALSB / OSB Java callout to gunzip
            Have tried logging to output, and this is what I get:

            $attachments[0]/ctx:attachment/ctx:body - empty

            <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
            <con:binary-content ref="cid:2a96c6b3:12da3c4b844:-7f3c" xmlns:con="http://www.bea.com/wli/sb/context"/>

            <con:endpoint name="ProxyService$FredhopperExtract$ProxyServices$Test GZip" xmlns:con="http://www.bea.com/wli/sb/context">
            <con:request xsi:type="file:FileRequestMetaData" xmlns:file="http://www.bea.com/wli/sb/transports/file" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <tran:headers xsi:type="file:FileRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
            <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>

            None of these actually have the contents of the message - the $body is the closest which tells me that it is binary and has a ref.
            • 3. Re: ALSB / OSB Java callout to gunzip
              Anuj Dwivedi--Oracle
              <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
              <con:binary-content ref="cid:2a96c6b3:12da3c4b844:-7f3c" xmlns:con="http://www.bea.com/wli/sb/context"/>

              So, it is your body ($body) variable which holds the binary file data. For passing it's content to java callout, you may refer -

              Re: Sending the binary-content to a byte[] argument in a Java Callout
              how to read byte[] in OSB

              Let us know if you still face any issue.