Thursday, July 29, 2010

Outbound dbAdapter sample in Oracle Service Bus

In last exercise we have seen an inbound scenario now we will see how does OSB work in an outbound scenario.

I believe you are using the same db connection which we have used in our last exercise.

Open up your jdeveloper

Create a new project ,make it an empty bpel process



Drag and drop a db adapter and give it some logical name






Make an insert operation




I am using the same table which i have created in my previous exercise



Now keep on saying next by choosing one primary key and save it so you project will look something like this



You can notice there are two wsdl file created.

One is the wsdl file that contains the information which we have provided through the gui and the other is outbound header wsdl file which is created automatically by the jdeveloper.



Now we will create the proxy service in osb.log in to osb console and create a new schema interface.



Choose the xsd file that is generated for the outbound service created



Now create a wsdl interface





Choose the outbound header file first as shown below



Now create one more wsdl interface and choose the dbadapter wsdl created for the gui
and save them.




Once all files are imported.

Create a new business service and call the wsdl for the gui,I am not sure why proxy service didn't work in this case

Every time i was trying to do so i got error like

Invalid WSDL for JCA proxy service. If you are creating a Proxy from a Business Service, please select a different transport type (for example, http). If not, WSDL must contain JCA activation spec properties.
Type com.bea.wli.sb.transports.TransportException


I believe we are performing a business of inserting the data in to database and it is not just a simple proxy call hence we are not able to make it work with proxy service.

Create a new business service



Select the port for the wsdl for the gui




Verify your connection details




Now in the next screen choose your toplink file



Just click on next and save your project.Once saved activate your changes and test the process by clicking on the following location



Unfortunately when i test this i got this error

The invocation resulted in an error: Invoke JCA outbound service failed with application error.

I am not good in debugging OSB and not sure which all files to located to find out the error and how to fix this.I will be trying to get this fixed.In the mean time if reader can suggest on this they are most welcome.

Well i got this before any one could get back to me.The reason was that my listener was not up.I started my listener and it started working.

So you must keep in mind the following steps

1>Your listener is up.
2>Database is up.
3>You have configured you data-source(refer previous post)
4>You have configured connection factory.

And most important is that when ever you create a new connection(outbound) don't forget to update it from deployment and it should work so in my case i got the following output



And in my database i can see the data being updated


1 comment:

unknow said...

Thanks for sharing such an informative post.
https://www.login4ites.com/