Pages

Sunday, March 22, 2009

Calling OSB services from BPEL

In my previous blog I already talked about calling BPEL services from OSB. In this blog entry I will show you how to call an synchronous OSB proxy service from BPEL. If you have problems to get this working, please see my previous blog entry how to solve this. I got this working with OSB 10.3 and Soa Suite 10.1.3.4 MLR5.
First we need to have an OSB proxy service with an WSDL.
As transport protocol we will use the SB protocol
Export the WSDL of the OSB Proxy service and put the wsdl and xsd's in your BPEL project.

When we take a look at the WSDL we can see that the OSB proxy service address is sb://xxx:70001/w..

In the BPEL project we can add a partnerlink, where we will use the OSB proxy wsdl.

Next step is to add an invoke process activity where we can select the OSB Partnerlink and we have to create an input and output variable here.


You only have to add some assign process activities to fill or retrieve the input and output variable.

36 comments:

  1. Hi Edwin
    I am facing problem making BPEL PM (SOA Suite10.1.3.4) work on WebLogic9.2 --> Installation is complete and ESB and OWSM consoles are opening up correct but the BPEL PM is failing to start up with the following Error:

    Exception preparing module: EJBModule(ejb_ob_engine.jar) Unable to deploy EJB: D:\bea\user_projects\apps\soaApps\BPELPM\ejb_ob_engine.jar from ejb_ob_engine.jar: Unable to set the transaction attribute for method 'addNamespace' on EJB 'ServerBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your interface for this EJB.

    --
    Can you please suggest something

    thanks
    debashis

    ReplyDelete
  2. Hi,

    I never did this. but I know there is a guide how to this and there is a oracle vm image available where it works out of the box.

    but I know a little bit about ejb, you have to change the oracle setting to wls setting maybe there is a chapter about this subject.

    thanks Edwin

    ReplyDelete
  3. Nice post, its working fine for me.

    ReplyDelete
  4. What is the proper way to call an osb service that is not created from a wsdl using jdev? maybe a messaging service? osb doesn't produce a wsdl for any proxy service...

    thanks,

    m

    ReplyDelete
  5. Hi

    JMS is working perfectly for this.

    Thanks

    ReplyDelete
  6. Hi Edwin,

    I have a scenario where i want to call a OSB from BPEl.
    The OSB is a messaging service,in the proxy i am calling the execute-sql to get data from Oralce DB.

    This OSB process ia not creating the WSDL itself.
    Please provide me info on creating a OSB process which would do this.

    Regards
    Ashwini

    ReplyDelete
  7. Why to use sb protocole, why cant we use simple http, i created a simple partner link using proxy service wsdl, and after invoking from BPEL I got the following error.

    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found

    ReplyDelete
  8. Hi,

    The OSB is a messaging service,in the proxy i am calling the execute-sql to get data from Oralce DB.

    Do you use xquery for this

    This OSB process ia not creating the WSDL itself.
    Please provide me info on creating a OSB process which would do this.

    Are you using jms and do you need this.

    thanks Edwin

    ReplyDelete
  9. Hi,

    Why to use sb protocole, why cant we use simple http

    This should be working but sb protocol is faster like rmi.

    I don't know what goes wrong with http

    ReplyDelete
  10. Hello, Edwin,
    The example you showed here is calling synchronous OSB proxy service, so how did you configure Proxy Service to be synchronous?

    Thank you in advance.
    -Simon

    ReplyDelete
  11. Hi

    with synchronous I mean that the wsdl I use in the proxy is synchronous.

    ReplyDelete
  12. hi, I followed the steps you posted. I'm experimenting this exception: java.net.MalformedURLException: unknown protocol: sb

    I'm using 11.1.1.4 OSB/BPEL version, can you help please?

    Thanks in advance.

    ReplyDelete
  13. Hi,


    This is for the old bpel , but you export the wsdl from the sbconsole and in the composite use a direct binding service and load the wsdl .

    In my coming OSB book , I describe the possible four scenarios you can have. From and to bpel and sync , asynchronous


    Thanks

    ReplyDelete
  14. Hi Edwin,
    The first step [First we need to have an OSB proxy service with an WSDL.
    Edwin Biemond].Should I create a new bpel process which is blank and take the input request.I should use this wsdl for osb proxy service?

    ReplyDelete
  15. Hi,

    just make a simple working osb proxy and the bpel can be very simple.
    which invokes this osb proxy .

    good luck

    ReplyDelete
  16. Hi Edwin,

    This looked pretty simple and well explained although while I am trying with my sample project it is failing. I am dying to have the soa-direct communication to avoid my application doing https calls in the way how our environment was created where all of our proxy otherwise have to go through https which will be expensive inspite of both soa-infra and osb residing on the same environment


    <[ACTIVE] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <643235279776e357:-56ba183f:13738a0b047:-8000-000000000006bce2> <1337033056465> <
    com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
    messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}

    at com.collaxa.cube.engine.ext.bpel.common.BPELWMPHelper.evalFromValue(BPELWMPHelper.java:333)
    at com.collaxa.cube.engine.ext.bpel.v1.wmp.BPEL1AssignWMP.__executeStatements(BPEL1AssignWMP.java:137)
    at com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform(BaseBPELActivityWMP.java:158)
    at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:2543)
    at com.collaxa.cube.engine.CubeEngine._handleWorkItem(CubeEngine.java:1165)
    at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1071)
    at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:73)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:220)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:328)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4430)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4362)
    at com.collaxa.cube.engine.CubeEngine._createAndInvoke(CubeEngine.java:698)
    at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:555)
    at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:103)
    at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvoke(CubeEngineBean.java:145)

    ReplyDelete
    Replies
    1. Hi,

      business-process/}selectionFailure is a bpel error. Did you get the request from OSB. it looks like a field does not have a value.

      thanks

      Delete
  17. Hi Edwin ,

    I thought the same. Actually I tried it with SOA Direct and with HTTP. It worked fine with HTTP but failed while I used the SB protocol.

    Thanks,
    Mitz

    ReplyDelete
    Replies
    1. Hi,

      Did you copy the direct binding url from jdeveloper ( resource pallette ) and add this on the business service. It works very strict.

      Can you invoke it with the java api . like this
      http://biemond.blogspot.com/2009/11/calling-soa-suite-direct-binding.html

      thanks

      Delete
  18. Hi Edwin(Wizard of SOA),
    Thank you very much for your prompt reply.
    I followed the exact same steps . My osb proxy uses the sb protocol. Added the partner link exactly as described and do see the wsdl changes as well. The link you sent me am not sure if that is what I was looking for or am missing something.

    Can I send you my sample code for WS ,BPEL and OSB Jar . You may want to just run the customization for OSB as per your WS deployment . I developed it for a sample calculator project .

    Thanks,
    Mitz

    ReplyDelete
  19. Hi Edwin,

    I added some fault handlers and had to catch the exception and while looking at the flow it seemed wierd. It is not giving the response. After invoke I see the following payload.





    10
    20






    10
    20






    It should rather be





    10
    15






    25





    So the failure here is "/ns2:addResponse/return" is missing and hence I am getting the selectionfailure. I am just wondering that sb communication is not happening . I have the sbtransport application running are there any other pre-reqs I should check . My proxy is based on sb transport too so what am I missing here. I configured the OSB proxy as per the guidance here .

    Would appreciate if you could help me out with this . If this POC of mine works then I have to do some major refactoring in our other projects.

    Thanks,
    Mithesh

    ReplyDelete
    Replies
    1. Hi
      Can you send me your test case and i will take a look.

      Thanks biemond at gmail dot com

      Delete
    2. Hi,

      I got your testcase working.

      You should export the sb osb proxy wsdl and in the composite you should the direct binding instead of the ws binding . And use the exported wsdl in the direct binding.

      thanks

      Delete
  20. Hi Edwin,
    I created a OSB based on a WADL.Please explain how to create the wsdl of my proxy service in this case.


    Thanks

    ReplyDelete
  21. Hi Edwin,
    Thank you very much for your post. It was quite informative. I have a scenario where an OSB Service A calls another OSB service B. Now, I want to call the service A from BPEL. But for some reason, I am not able to get the Export wsdl from the OSB console for the service A.
    I am new to OSB and I am still in learning mode. The service A is not a wsdl based service. Please help, I am stuck.
    Suresh.

    ReplyDelete
    Replies
    1. Hi,

      Service A should have a wsdl for BPEL, what did you define on service A.

      Thanks

      Delete
  22. Hi Edwin,

    I have a BS on OSB which calls bpel process which invoke another PS on OSB. Transport in two way is on local transport (sb) and it works. I'm sending bad request and I know that the proxy service is receiving soapFualt but my bpel process doesn't understand it and I'm getting it:

    Non Recoverable System Fault :

    could not dispatch message because there is no active transaction. there is no active transaction while scheduling a message with the dispatcher. this usually happens if the underlying subsystem rollback back the transaction without bubbling up the system or transaction exception to the bpel layer. Contact Oracle Support Services. Provide the error message and the exception trace in the log files (with logging level set to debug mode).

    Non Recoverable Business Fault :
    BusinessFault : A Transport Exception occurred during an SB Transport message processing..

    What should I do to throw my soapFault error via bpel to BS on OSB??

    Regards,
    Adrian

    ReplyDelete
    Replies
    1. Hi,

      you want to send a soap fault from BPEL to the BS which invokes it.
      This is probably 1 way operation, which does not support soap fault and only get back HTTP 200 ( soa can handle this, it is not a standard ) or did you make this a synchronous service BS <-> BPEL with soap fault in the WSDL.

      You should pass on this error to the OSB proxy ( not the BS ) and this is not a soap fault , a normal message with some fields which has the error information.

      Thanks

      Delete
    2. How about config like that (2-way operation, request and response):
      [BS] ---(sb-transport)---> [BPEL] ---(sb-transport)---> [PS]

      BPEL is connected do OSB via DirectBinding both on ExposedService (BS) and External Reference (PS).

      When PS responses to BPEL with SoapFault Response - BPEL generates this oracle.fabric.common.BusinessFaultException.

      <Error occured when fetch entity manager
      ORABPEL-05007

      could not dispatch message because there is no active transaction.
      there is no active transaction while scheduling a message with the dispatcher.
      this usually happens if the underlying subsystem rollback back the transaction without bubbling up the system or transaction exception to the bpel layer.
      Contact Oracle Support Services. Provide the error message and the exception trace in the log files (with logging level set to debug mode).

      Any idea how to handle this behavior? Transaction config or FaultPolicies maybe?

      Delete
    3. My BPEL process receive saopFault from OSB. When I'm using http transport everything works fine and my policy bindings also works. But when I'm using SB transport and in response my BPEL process receive soapFault I get this exception with SB transport. It is a two way process. Any idea how to resolve it??

      Delete
    4. Hi

      SBtransport support transactions maybe you can do it in a separate transaction. Else it is a bug.

      Thanks

      Delete
  23. Hi Edwin,

    I have requirement like , i need to call a proxy service in Bpel, Bpel pass the customer information payload(xml data) to the proxy,

    proxy stores the data in AQ persistan store, before that it should call the intermediate synchronous webservices for some bussines logic.

    How can i pass the customer data to to proxy service?

    Thanks
    Raja

    ReplyDelete
    Replies
    1. sorry small correction in above post,

      After enqueue the data to AQ , my proxy will be calling other third part web services for business requirements.and while enqueue it should do XQuery tranformation so i couldn't use the proxy service type of JCA based WSDL.

      Delete
    2. Hi,

      just pass on the data from BPEL to OSB ( just like a normal web service ) add a pipeline pair in the messageflow which can do a service callout on the request or response line and at last call the JCA AQ business service.

      Thanks

      Delete
  24. Hi Edwin,

    I caaling a SB proxy in my bpel (SOA 12 C) using SB_Direct but .I am not able to see any response.Tags coming blank.dont know whats wrong help me

    ReplyDelete
  25. Hi Edwin,

    We are exposing a proxy service from osb using SB protocol. This service has two operation and there message are different but the payload elements are same.
    so we are getting exception "Two nodes are having same message" exception when we use the operation selection algorithm as SOAP Body type, but after that we are using SOAP Action Header and that error is no more. Now after that when we are calling proxy service from mediator in soa, and we are getting response as same as request.

    ReplyDelete