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

Have tried logging to output, and this is what I get:
$attachments[0]/ctx:attachment/ctx:body - empty
$body
<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"/>
</soapenv:Body>
$inbound
<con:endpoint name="ProxyService$FredhopperExtract$ProxyServices$Test GZip" xmlns:con="http://www.bea.com/wli/sb/context">
<con:service/>
<con:transport>
<con:uri>file:////apps/bea/dp_tmp</con:uri>
<con:mode>request</con:mode>
<con:qualityOfService>best-effort</con:qualityOfService>
<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">
<file:fileName>/apps/bea/dp_tmp/test.txt.gz</file:fileName>
</tran:headers>
<tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
<file:isFilePath>false</file:isFilePath>
</con:request>
</con:transport>
<con:security>
<con:transportClient>
<con:username>&lt;anonymous></con:username>
</con:transportClient>
</con:security>
</con:endpoint>
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.

Similar Messages

  • How to Create a connection pool in OSB java callout

    Dear Team,
    In our project, we need read some data from DB, and do corresponding operation. currently, we need setup the connection first, execute the SQL, and close the connection.
    But the concurrency of call is very high, is there a way to create a connection pool, then we can use the connection pool to get the connection and execute the SQL, then return the connection to the pool.
    if connection pool is not available, is there any way to create the connection outside the java callout, that we can just execute the SQL in java callout.
    The OSB version is 11.1.1.6.0
    Thanks.
    Best Regards,
    Raysen Jia
    Edited by: Raysen Jia on Oct 16, 2012 8:44 AM

    Hi Team,
    Thanks for your help.
    What I need is not only the db connection, may be other kind of things, such as read configuration from file...
    If I write the code in java callout with static java method to create and close the connection, each time when request come in, OSB will create a new connection (or read the file), I think it's not the best practice to do this kind of work.
    I think the weblogic is running in JVM, is there any way we can define variables or new object in the JVM directly?

  • OSB Java Callout, no methods shown when selecting jar

    Hi,
    I'm trying to invoke a Java method in OSB. I've already done this before with a simple static method. What this time is diffrent is that now my jar contains dependency to another jar, like Xerces.
    After I've imported my jar, and I'm trying to select a method, there is no method for me to select. I've tried doing it in either osb console, and OEPE.
    I suspect that the reason for this is the fact that there are imports in the jar. The things I've tried:
    * putting all the imported jars in classpath in MANIFEST file in the jar,
    * importing the imported libraries to osb as well,
    * putting imported jars in the lib directory of the domain (and restart),
    * adding all the imported jars to the servers classpath
    but to no avail.
    Or it could not be related to the imports at all.
    Method signature:
    public static String prepareEnvelope(String envelope) throws TransformerException, SAXException, IOException
    Help? Suggestions?
    Edit: OSB console doesn't seem to see this method either:
    package myPackage;
    public class Test {
         public static String test(String arg) {
              return "kitten";
    What's going on?
    Edited by: Veronica on Dec 13, 2012 2:59 AM

    I seem to have resolved my own problem. I complied the Java project using Eclipse and Java 1.6. After I've changed the "compiler compliance" from 1.7 to 1.6, my project is being shown in OSB.
    Yay

  • OSB: send dateTime do Java Callout method

    Hi,
    I have a method in Java that receives a parameter of type java.util.Date and I want to invoke that method in an OSB Java Callout Activity.
    I receive in the OSB 11g service input an element of type xs:dateTime and I want to send it to the Java method this element. But it always result in exception: argument type mismatch java.lang.IllegalArgumentException: argument type mismatch.
    Is there a way to pass this element to Java Callout without having to pass first a string and then convert to java.util.Date?

    bad news
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/eclipsehelp/ui_ref.html#wp1290279
    java.util.Date is not supported

  • How to Handle Multiple Thread in JAVA Callout with OSB 11g

    Hi Team,
    With My OSB 11g, I want create a static Thread when Java callout.
    Java code as below.
         private static Thread thread;
    static {
              * lazy load thread and with thread-safe ensure
              if(thread == null){
                   synchronized (HornetQConnectionHelper.class) {
                        thread = new ConnectionRecoveryThread();
                        // Daemon thread, JVM level, Won't be interrupted, Safe!
                        thread.setDaemon(true);
                        thread.start();
    When this class was first called in OSB, the thread start run. while when I redeploy it, the old Thread is still running, if call the class again, it will create a new Thread. The two threads will run at the same time.
    Any body know how do configure it, so that there is only one static Thread in the Weblogic JVM.
    Thanks.
    Best Regards,
    Raysen Jia

    Hi Raysen Jia,
    Create a weblogic startup class... See the references bellow...
    Hope this is helpful...
    http://jagadesh4java.blogspot.com.au/2010/05/working-with-weblogic-startup-shutdown.html
    http://docs.oracle.com/cd/E23943_01/upgrade.1111/e10126/basic_upgrade.htm#FUPAS464
    Cheers,
    Vlad

  • Including library dependency for Java Callout in OSB Proxy

    Hi,
    I have a simple question for which a simple answer is eluding me:
    I have developed a simple Java Callout for us in a proxy message flow and that Java class has a dependency on the Commons IO library but for the life of me I can see how I can ensure the proxy is deployed with the library in the classpath because when I perform a simple publish and test the service I get the exception:
    <8/06/2009 10:22:27 AM NZST> <Error> <OSB Transform> <BEA-382515> <Callout to java method "public static void com.oracle.mtm.tools.Archiver.archive(byte[],java.lang.String)" resulted in exception: null
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at etc...
    java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
         at etc...
    i.e. the Commons IO (e.g. org/apache/commons/io/FileUtils) is not in the classpath.
    There must be a simple way of declaring this dependency or something and have the library loaded but I can't find it.
    Any help much appreciated!

    Well I managed to answer my own question in the end. It's simply a matter of selecting jar dependencies from other jars which can be done by double clicking ("opening") the jar within the OSB Conf project which opens a jar dependencies dialogue box. As expected it's easy when you know how...

  • Java Callout with Collections in OSB

    I need return a collection (List) in Java Callout Action, i recive only this content in any variable:
    <con:java-content ref="jcid:15906698:135e486b745:-7f91" xmlns:con="http://www.bea.com/wli/sb/context"/>
    how i do for read or convert to list in OSB message flow ?
    my escenary is, excecute un method in java callout, this method recive a colection and return a collection. i cant view estructur in message flow. only view <con:java-content.....
    can any help me?
    I need your help.
    Regards
    [email protected]

    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/eclipsehelp/ui_ref.html#sj_uiSplitJoinJavaCalloutProperties
    try returning an Array, it seems more supported than a List :o)

  • ALSB - Java Callout (.jar using commons-httpclient-3.1)

    Hello everyone,
    I'm having a not so funny problem.
    I made a Java class, that will be called by a Proxy Service (Java callout). I'm using the commons.httpclient-3.1.jar (+ codec and logging).
    Here's the code:
    package util.http;
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.methods.*;
    public class UtilitaireHTTP {
    // method used by the Proxy Service
    public static String getLastModified (String url){
    return getHeader(url,"last-modified");
    private static String getHeader(String url, String header){
    HttpClient client = new HttpClient();
    String lastModified = "404";
    HeadMethod head = new HeadMethod(url);
    try {
    //not working
    /*int statusCode = client.executeMethod( head );
    if (statusCode == 200){
         lastModified = head.getResponseHeader(header).getValue();
    //working
    lastModified = "200";
    catch(Exception e){
         System.out.println(e);
    finally {
    // release any connection resources used by the method
    head.releaseConnection();
    return lastModified;     
    Here's the problem: Whenever I remove the comment block, test it (it's going to work with JUnit), create a JAR. Import it into ALSB jar resources folder. When I do a Java Callout in a Proxy Service I won't be able to see my method getLastModified. If I put that block in comment, re-do all the export import, I'll see the method in the list.
    //not working
    /*int statusCode = client.executeMethod( head );
    if (statusCode == 200){
         lastModified = head.getResponseHeader(header).getValue();
    //working
    lastModified = "200";
    Anyone knows the solution or problem.
    Thank you!
    Van

    While playing with java callouts i've built working "groovy callout" sample. This way you can keep logic in your alsb proxy service rather than in jar file. Have a look. http://blog.aujava.com/?p=64

  • OSB JAR Resources for Java callout in Cluster

    Hi,
    I have a JAR Resource, which has one simple java class with one static method. I invoke this method using Java Callout in my proxy service.
    This all works fine if I am in single node environment, when I move to Cluster two node environment, I export the current single node config and import in cluster config, all services work fine except that JAR is available but I cannot access any methods and when I click on this JAR Resource it says "JAR Resource not found". Is there a special consideration for moving custom JARs to OSB Cluster.
    Please can someone provide some details on this, greatly appreciate.
    thanks
    KD

    Here are some more details, basically I have a JAR which has methods, so I created a JAR resource in cluster, and it uploads my jar successfully. I see a resource name now, when I click on this resource it says "resource not found".
    If I do the same exact steps in non-clustered environment, it just works fine without problems.
    In cluster configuration I went to each node including admin and verified that .ar file is there.
    If I export now what I have in cluster, the exported configuration JAR does have a mycustomjar.Archive file. But I am not able to access it in console.
    Also I want to say thanks for helping me, please let me know what I can verify more.
    thanks
    KD

  • Validation failed for ArchiveClassLoaderDerivedType- Java callouts from OSB

    Even though jar file for java classes are present, I am receiving the following error sometimes:
    com.bea.wli.config.component.NotFoundException: Validation failed for ArchiveClassLoaderDerivedType ..Referenced component (ArchiveClassLoaderDerivedType ../../Java/.._ArchiveClassLoaderDerivedType) not found.
    When I bounce the server then it works, but I can't bounce the server in production. Do anybody know why this is happening?

    Unfortunately ALSB/OSB does not seem to honour JAR files packaged in your JAR and referenced by the manifest Class-Path attribute. As well, the JAR files deployed into a project cannot reference each other. As such, you either have to open the library JAR and stick it into the one you are deploying or to put it on the server classpath via the domain lib (you do not need to edit the start scripts). This is definitely a hole in the capabilities of OSB.

  • Email sending through java callout in osb

    In osb -- proxy service -- service callout -- i am getting a value using dbadapter select
    Then i am using if then condition to perform some operations
    After this step i need to notify this value to a user saying ... the account balance is this much
    In our project already there is a java callout program to send emails to the concerned people ... it is used to notify some other thing like reprocessing activity etc., which was previously developed.
    If i want to use that java callout option to send emails ... do i need to write a new java method and use that class file in this email sending java program and route my program to this service
    Will this work ?
    Thanks,
    Rahul

    do i need to write a new java method and use that class file in this email sending java program and route my program to this serviceYou may directly re-use that existing Java callout if it exposes a static method for starting execution. If it does not expose a static method, then you may write your own class which exposes a static method to be called by OSB, and from that method you may invoke your existing Java callout.
    Regards,
    Anuj

  • Java Callout in OSB failing with null pointer exception

    Hi,
    We have a requirement where we need to convert XML String to org.apache.xmlbeans.impl.values.XmlAnyTypeImpl type using java-callout, but value is not getting set when we are trying to do the same. Below is the code we are using in the java callout:
    byte [] bArray = xml.getBytes();
    InputStream is = new ByteArrayInputStream(bArray);
    Reader reader = new InputStreamReader(is,"UTF-8");
    InputSource iss = new InputSource(reader);
    iss.setEncoding("utf-8");
    xmlNode1 =
    DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(iss);
    XmlAnySimpleType xmlObj = XmlAnySimpleType.Factory.parse(n);
    xmlAnyTypeImpl.set_newValue(xmlObj);
    Node resNode = xmlAnyTypeImpl.getDomNode();
    Can someonce please help for the same.
    Regards,
    Soumik

    First check whether the java class that is called is able to read the string message that is passed by the proxy service.

  • In OSB 10,3, a Java Callout runs in the same thread of the Proxy Service?

    Hello,
    a I have a Java Callout within the Proxy Service, request pipeline.
    Does it runs in the same thread of the Proxy?
    If NOT,
    which work manager is the Java Callout pinned to?
    can I set the work manager I want?
    Thank you,
    regards
    F.Costa

    Thanks a lot.
    Pointer to great info.
    However doesn't mention Java Callout threading, nor the documentation does.
    Anybody with a YES or NO, please...
    F.Costa

  • Log in ALSB/OSB

    Hi everyone,
    I would like to know if it's possible to use the log activity of the ALSB/OSB in a separate log file of the WLS. I would like to have a different log for every service I have in my ESB. Is it possible to do with log activity or I need to develope a Java Callout with log4Java?
    Any ideas?
    Thanks!.

    Maybe this can help:
    Re: Need help in logging the response in single file

  • Invoke DBAdapter from Java Callout

    Hello,
    in OSB I need to invoke a DB-Adapter from a Java Callout. How can I achieve this?
    I cound not find any documentation about this (javadoc etc).
    Horst

    Ideally you should not need to access DB adapter from a Java callout. Use java callout for transformations, get back the transformed data, and call a business service based on DB Adapter.
    Alternatively, call java callout and make write code in Java to access DB directly using Weblogic datasource and connection pool.
    And if you dont want to do it any other way, create a business service based on the said DB Adapter, create a wrapper proxy(which internally calls the DB adapter based business service) of Any XML type with HTTP transport or even a WSDL based webservice, and call this from your Java code.

Maybe you are looking for