How to get response from an asynchronous BPEL process in Java

I'm experimenting with BPEL and doesn't seem to be able to get response from an asynchronous BPEL process. Here's the deal:
I have a BPEL process that takes a string as input, and gives another string as output. This is a asyncronous process.
I want to initiate this BPEL process as a web service so I generate a Webservice Proxy in JDeveloper 10g (10.1.3.0.4). The function to call the process is now called "initiate" and takes three arguments: the input string, a "org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType replyTo" and a
"org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI messageID".
HTTP-Analyzer shows that invoking the BPEL process with initiate("somestring", null, null) results in sending a SOAP message to the BPEL process, which returns a "202 Accepted". How do I get the response from the process? My intuition tells me that I have to use that second argument, that EnpointReferenceType thing. How do I use that?
Another question: If a asynchronous BPEL process does not exists (so the endpoint does not exist) the Java proxy does not throw an error when runned. It does not even sends a message. It exits with status 0! (This happens for example when deploying a new version of a process and when the "old" version is undeployed). Calling a non-existing synchronous BPEL process, the Java proxy DOES throw an error.

Clemens,
That all sounds logical. But somehow it is still a mystery for me ... Somehow I don't see what should be done.
To call the async BPEL process I have the following procedure:
initiate(String input, org.xmlsoap.schemas.ws._2003._03.addressing.EndpointReferenceType replyTo, org.xmlsoap.schemas.ws._2003._03.addressing.AttributedURI messageID)
The first argument is the input for my BPEL process. The second is the address to a webservice that should handle the callback, right? The third is a messageID (makes sense, but why of the type AttributedURI?).
Here lies my problem. It is not clear to me how these EndpointReferenceType & AttributedURI work. I can't find anything on the net about it. The AXIS examples as where mentioned earlier use other types (namely the "org.xmlsoap.schemas.ws.addressing.MessageID" and "org.xmlsoap.schemas.ws.addressing.ReplyTo") which are completely different.
What I did so far:
- I created an webservice proxy that listens on the onResult endpoint of the BPEL process.
- I created an webservice proxy that calls the BPEL process through the initiate procedure, but it is not completely clear to me how to construct the EndPointreferenceType replyTo, and the MessageID. I did something like this:
EndpointReferenceType replyTo = new EndpointReferenceType();
// callback service running on local machine
// This URI class is the java.net's version
URI replyToURI = new URI("http://vaccinatie:8988/syncro-callback-context-root/stringconcatCallbackBindingPort");
// This AttributedURI is the org.xmlsoap.schemas.ws._2003._03.addressing's version
AttributedURI address = new AttributedURI();
// the only public methos that made sense to me:
address.set_value(replyToURI);
replyTo.setAddress(address);
// call the BPEL process
myPort.initiate("test123", replyTo, address);
But the above doesn't work (largely because I don't know what I'm doing here prob.:-) ) It does send the "test123" message, and the BPEL process does process it, but I don't seem to get the callback right.
I hope this makes my problems somewhat clearer. I hope someone can help me, because I'm just a beginner in this whole "web service area" and seems to do something terribly wrong here, because it should be very simple. Thx.

Similar Messages

  • How  to get  response from such a  function

    How  to get  response from such a  function (in MODULE USER_COMMAND_0010 INPUT I get "ODGOVOR" 'X'
    FUNCTION Z_SEENKRAT.
    ""Local Interface:
    *"  EXPORTING
    *"     REFERENCE(ODGOVOR) TYPE  MSEG-KZEAR
    DATA ok_code LIKE sy-ucomm.
    DATA: test like mseg-kzear.
    BREAK-POINT.
    call screen 10.
    test = ODGOVOR.
    ENDFUNCTION.
    *&      Module  CLEAR_OK_CODE  OUTPUT
          text
    MODULE clear_ok_code OUTPUT.
      CLEAR ok_code.
    ENDMODULE.                 " CLEAR_OK_CODE  OUTPUT
    *&      Module  USER_COMMAND_0010  INPUT
          text
    MODULE USER_COMMAND_0010 INPUT.
    DATA odgovor LIKE mseg-KZEAR.
    CASE ok_code.
        WHEN 'DA'.
        ODGOVOR = 'X'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0010  INPUT

    Hi,
    You need to declare the ODGOVOR variable in the TOP include, then you will get the value
    Regards
    Sudheer

  • Throwing a fault from an asynchronous bpel process

    Hi,
    can anyone please let me know how i can throw a fault to the calling client from an asynchronous bpel process?
    (synchronous bpel uses the fault of the reply activity to do the same - i want a similar thing in a callback-invoke of an asynchronous process or any other way to do it if at all)
    please let me know if it is possible becoz it was a requirement put forward by a customer and i just want to develop a proof of concept to the same.
    regards,
    pavan.

    Hi,
    I'm using BPEL process manager for calling a asynchronous web service,I can invoke the service from BPEL and the service is invoked correctly,but when I view the business process flow in BPEL Console my process is stopped at receive state and doesn't pass it.
    Could anybody tell me if any thing should be set to receive a callback from an asynchronous web service to BPEL process?
    Is it true that BPEL process receives a callback automatically (using a callback operation which I defined in my web service WSDL) on the same port type that normally receives the requested information, with an invoke activity?
    So what could be wrong with my process or invoked web service that the BPEL process doesn't get any reply from my web service and remains in receive activity?
    Thnx in advance,
    Nasim

  • Implement callback for an asynchronous BPEL process through Java

    Hi ,
    I am trying to implement a callback functionality for an asynchronous BPEL process through java.
    I found the code in the samples folder of SOA suite installation folder .
    <SOA_HOME>\bpel\samples\tutorials\102.InvokingProcesses\rmi\com\otn\samples\async.
    There is an AsyncInstanceWatchdog object which registers a callback object(in this case an object of AsyncCallbackImpl class) for a specific CONVERSATION_ID.
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    deliveryService.post(proc_name, "initiate", nm);
    // register the callback
    watchdog.registerAsyncCallback(convId, testAsyncHandler,
    locator.getDomainAuth());
    // start it
    watchdog.start();
    There is no problem till the last line. But once the BPEL process returns the control( does a callback), it throws the following error.
    May 25, 2010 3:36:06 PM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    ORABPEL-02118
    Variant not found.
    The variant "output" has not been declared in the current scope. All variants must be declared in the scope before being accessed.
    Please check that the variant "output" is properly declared; otherwise there may be a misspelling in the name of the variant.
         at com.collaxa.cube.engine.core.Scope.getVariantRV(Scope.java:535)
         at com.collaxa.cube.engine.CubeEngine.getFieldValue(CubeEngine.java:2668)
    For your reference the variable output is declared in the definition of AsyncCallbackImpl (which implements the IAsyncInstanceCallback interface).
    There are 2 methods defined in the AsyncCallbackImpl class.
    public void onResult(Map pResultMessage) {
    System.out.println("called back! ");
    Iterator iTest = pResultMessage.keySet().iterator();
    while (iTest.hasNext()) {
    String key = (String)iTest.next();
    System.out.println(XMLHelper.elementToString((Element)pResultMessage.get(key)));
    public String getVariableName() {
    return "output";
    The variable name is same given in the sample code. And the BPEL process returns variable named output. So the name should not be a problem.
    Is it because of the scope of the variable.. If so, how do I change it.
    Any help would be appreciated.
    Edited by: saptarishi on May 25, 2010 4:24 PM
    Edited by: saptarishi on May 26, 2010 4:45 PM

    Solved it by some googling .... :)
    Here is the link:-
    [http://abhishek-soablog.blogspot.com/2008/09/orabpel-02118.html]
    or
    [http://beautifulwaste.blogspot.com/2008/04/calling-asynchronous-bpel-process.html]
    Both gives the same solution..
    In pre 10.1.3.3 release the default behaviour were to keep global variable information along with the instance information for completed BPEL processes.
    In 10.1.3.3 or later, this behaviour changed for performance reasons so that the default behaviour is now, not to keep any global variables for a BPEL process once the BPEL process has completed.
    You can configure this behaviour on a process level basis by using the parameter keepGlobalVariables in the bpel.xml file for the specific process:
    <BPELSuitcase>
    <BPELProcess src=".........." id="...........">
    <configurations>
    <property name="keepGlobalVariables">true</property>
    </configurations>
    </BPELProcess>
    </BPELSuitcase>
    Thanks
    saptarishi

  • HowTo get the callback from an asynchronous BPEL process to an ESB?

    Hi,
    I have deployed an asynchronous BPEL-process which is called from an ESB. So far no problems. But I want to receive the callboack fromt this BPEL process on the ESB, too.
    How is this possible?
    Note: I have created the BPEL-Process before I created the ESB. So I cannot add the ESB as a partner link in the BPEL Process. Or is this the only way?
    Message was edited by:
    user636134

    Hi,
    I have deployed an asynchronous BPEL-process which is called from an ESB. So far no problems. But I want to receive the callboack fromt this BPEL process on the ESB, too.
    How is this possible?
    Note: I have created the BPEL-Process before I created the ESB. So I cannot add the ESB as a partner link in the BPEL Process. Or is this the only way?
    Message was edited by:
    user636134

  • How to get response from ActionableEmail

    Hi Helping hands,
    I have created HumanTask which is able to send actionable emails with links like (APPROVE,REJECT) & worklist application.
    If I act on the task through worklist I'm getting the response to my BPEL process.
    If I do the same by clicking the APPROVE link in the email, it opens a new email window without TO address but it contains subject and body as
    NID:iBeS8jSTsA7vOx+ULF3+dJ7/e1fbklcDLkGHlkj38emd71NnzMgQMN89C0RxaPzu2PPgelhp+hvQAhRwUYMWJw==:NID
    Comments [[ ]]
    I want to get the response of the task action in the BPEL process.
    Looking forward for your help.
    Regards
    VIki

    Hi,
    You need to declare the ODGOVOR variable in the TOP include, then you will get the value
    Regards
    Sudheer

  • Doubt: How to get Instance Id of a BPEL Process

    Hi All,
    I have a doubt in BPEL as to how we can get the Instance Id of a particular faulted process.
    Business Scenario
    We have a process which does the following:
    1. Dequeue message from a queue.
    2. Do the Transformation
    3. Insert the Output message into a Database Table by calling a Stored Procedure
    The BPEL Process will create multiple instances of the process after successful completion.
    Now we want to add fault handlers at each of the above steps which will catch any exception that will basically get the Instance Id of the particular faulted process and send it to a mailing list using E-mail notification Service mentioning the Instance Id of the Faulted Process.
    Currently we could not find any way on how to capture the Instance Id of the Faulted Process. We have this requirement because in Production Environment many instances of the process will be spawned and it will be difficult to know which Instance has faulted.
    Anybody familiar with a similar requirement or any pointers on how to achieve this, please post it and let us know.
    Thanks In Advance,
    Dibya

    This xpath function returns current instance id of running process ora:getInstanceId().
    But in your case I would do this flow in ESB. Because this kind of "provisioning" of data can be done in ESB. Each execution I would define as async. And when exception occurs it will be logged by ESB and moved to error hospital. Administrator can easily use ESB console to query faulted instances and if neccesary he can resubmit them.
    Just an idea how to make it faster, without doing some special development.

  • Getting the final result of BPEL Process through Java

    I am trying to invoke BPEL Process from Java code as follows:
    NormalizedMessage res=deliveryService.request("BPELProcess1", "process", nm);
    Map payload = res.getPayload();
    System.out.println("size=="+payload.size());
    Element e = (Element)payload.get("payload");
    Node node = e.getFirstChild();
    NodeList list = e.getChildNodes();
    for(int k=0;k<list.getLength();k++){
    Node n= list.item(k);
    System.out.println("Node-->"+n.getNodeName());
    The node names getting printed are :
    Node-->#text
    Node-->result
    Node-->#text
    When i retrieve value from these nodes using getNodeValue(), it is showing null for result. However through the BPEL Console, when i see the instance, it shows the result as 5 :
    <outputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    <BPELProcess1ProcessResponse xmlns="http://xmlns.oracle.com/BPELProcess1">
    <result>5</result>
    </BPELProcess1ProcessResponse>
    </part>
    </outputVariable>
    Any comments on this will help a lot. Thanks

    Does this example helps you:
    http://orasoa.blogspot.com/2007/06/calling-bpelesb-webservice-from.html

  • How to get the list of all running process in java

    hi all,
    i want to get the list of all running processes on my system. please let me know if it is possible to do with JAVA. which class i should use?
    waiting for reply
    bye

    Wrong forum. Just a hint.

  • How to get response from financial department

    How do I get someone in financial to review an account that has bad information in it ? Someone at Verizon has mistakenly used ACH (Bank) information and entered it as debit card information. When they tried to post to it, of course it failed. As a result I am now on COD cash only for the duration of my contract. No person in their financial division or in the regular customer service can seem to correct this. Any suggestions ?

    Update - I began a complaint with the BBB.
    I also called Verizon again as suggested, and asked for a supervisor again after explaining the situation. For the first time I spoke with someone who not only understood the problem but fixed it by changing the status of my account from cash only to auto payment.
    I received a call from an 'Executive correspondent' at Verizon regarding my complaint to the BBB. I related the entire story to her, after which she apologized and assured me she would look into why the original person I spoke with in financial services was unwilling to help, and that the assistant manager at the local store was unable to get help either. I implied that their customer service left a lot to be desired in its present form and, I agreed with her that some investigating needed to be done.
    I also asked why Verizon was unable to verify billing information before the actual transaction, as is done by many other corporations - Paypal being one. They will do a small (between .01 and .15) transfer then transfer it back. She informed me that Verizon had made a corporate decision not to do this as it would 'confuse' their customers. I disagree - their current system puts the entire responsibility for any errors on their customer. She confirmed that I had provided the correct information initially and had no explanation for how things turned out as they did.

  • How to get response from a servlet which depends on cookies?

    guys,
    i have a servlet which behaves differently based on the presence of a cookie or not. If cookie A is present in the machine it shows the the home page and if not it shows the login page.
    now i want to get the home page HTML content from a program without using the browser. i am aware this can be done by using java.net.URL but how do i simulate the cookie given that i know that's the cookie name and value it expects?
    Unfortunately i cannot paste the servlet code as it is a servlet of a product and i don't have the source code for it.
    Thanks
    S

    I believe you use URLConnection.setRequestProperty(), with the key being "Cookie".

  • How to resubmit failed activity in a BPEL process using Java in 11g

    Hi All,
    In 11g, is there any API using which we can resubmit failed activity in BPEL using Java.
    Thanks,
    Vidya

    Hello
    To assign a header
    1. Create a variable of the correct type
    2. Click on the invoke/pick/reply or the receive
    3. Click on the header tab
    4. Select the header
    Validate the header after the receive
    5. Select the header the varaible and use a validate action.
    Best Regards Tristan Hayman

  • Retrieving Status/Results from Asynchronous BPEL Processes

    Hi,
    I'm trying to poll the results of an asynchronous BPEL process with Java RMI. I managed to get the state of my instance, but i could not get the results of the process.
    When I use the method getResult I only get an empty Object[]. (see my attached code)
    I'm working with the tutorial 101.HelloWorld process.
    How can I acess the results of this process by using RMI?
    Thank youf for replies.
    Marc
    Properties props = new java.util.Properties();
    java.net.URL url = ClassLoader.getSystemResource("context.properties");
    props.load(url.openStream());
    Locator locator = new Locator("default", "bpel", props);
    IInstanceHandle handle = locator.lookupInstance("myInstance");
    if (handle.getState() == IInstanceConstants.STATE_CLOSED_COMPLETED)
    System.err.println(handle.getResult());
    }

    Hi,
    I am having exactly the same problem.
    Was this bug ever solved ?
    Thanks,
    Claudio.

  • Error while invoking an asynchronous BPEL process

    Hi ,
    I am trying to call an asynchronous BPEL process through java client.
    Following is the code which I got from SOA bpel samples present in the following location
    <SOA_HOME>\bpel\samples\tutorials\102.InvokingProcesses\rmi\com\otn\samples\async
    The code fails while registering the callback
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    deliveryService.post("HelloWorld", "initiate", nm);
    // register the callback
    watchdog.registerAsyncCallback(convId, testAsyncHandler,
    locator.getDomainAuth());
    The error says java.lang.NoClassDefFoundError: org/collaxa/thirdparty/json/JSONString
    I tried to search for this in google. But it seems noone has got this error or maybe noone has used this at all.
    Maybe I am missing some jar file, but I am unable locate that.
    Can someone help me in this please.

    Hi,
    These sort of class not found errors come when you are running from a client which does not have all the jar files requried to invoke BPEL using the client API.
    org/collaxa/thirdparty/json/JSONString is orabpel-thirdparty.jar.
    The complete list of Jar files you would need in the classpath are:
    ejb.jar ($ORACLE_HOME/home/lib)
    oc4j-internal.jar ($ORACLE_HOME/home/lib)
    optic.jar ($ORACLE_HOME/opmn/lib)
    orabpel-common.jar ($ORACLE_HOME/bpel/lib)
    orabpel-thirdparty.jar ($ORACLE_HOME/bpel/lib)
    orabpel.jar ($ORACLE_HOME/bpel/lib)
    Hope this helps,
    Regards,
    Shanmu.
    http://www.prshanmu.com/articles/

  • How to call a Asynchronous bpel process from a PLSQL procedure?

    How to call a Asynchronous bpel process from a PLSQL procedure?

    Hi,
    You could do something smart and technical very spiffy with soap-stacks in the database and/or dbms_ws/dbms_http. But I allways find AQ with AQ-adapter the simplest. Let Pl/sql enqueue a message on an aq-queue and subscribe an aq-adapter process on it. That can call your async-bpel process. If you want to get answer back in pl/sql, let the aq-adapter process enqueue a response message on another queue or on the same queue with another consumer name. Give it a correlation-id that you provided in the payload of your request message. Your pl/sql process can then do a dequeue on that correlation-id. It will sit and wait until a message with that correlation id is enqueued on the queue.
    Regards,
    Martien

Maybe you are looking for

  • Cinema Display 30" problem

    Hi I have a 30 inch Cinema Display from 2006-ish. I have not used it for a while and when i powered it up again a few days ago it was kind of broken. There is no image from my Mac, only these vertical lines (check the photos). The lines change a bit

  • Brought film is out of sink between action and voice

    I purchased a film but on playback it is out of sink the action is not matching the sound I am using windows 8 can some one help others wise i will not purchase anything from itunes again

  • Create a Template Editable Region Link with static "label"?

    Hello. Does anybody know how to create a simple, basic link on my template (just the word "LINK" will do) . . . . and put an Editable Field *behind* the "LINK" . . . so I can change the link destination link on each child page? So, in the particular

  • I can't get my music after changing phones

    I can find my music under past purchases and download all, but they never show up. I have tried to sync with my computer and nothing happens either  

  • Safari will not load websites

    I have a 16GB iPhone 3GS and last night it stopped loading pages. I've searched through these archives but couldn't find an official solution from Apple, which is highly disappointing. Has anyone else had this happen, and if so, how did you resolve i