Friday, May 26, 2006

How to Publish an Oracle ADF Business Component as a Web Service in JDeveloper 10.1.3

It's a question that comes up regularly. You have a custom method in your Business Component Application Module and want to expose it as a web service. The way it's done has changed a little since 10.1.2.

First you want to expose the method to the client interface
  1. Open the Application Module Editor
  2. Select the Client Interface page and shuttle the method to the Selected list


Now you can generate a Web service from the methods in the client interface

  1. In the Application Module Editor, select the Remote page
  2. Select the Client Interface page and shuttle the method to the Selected list
When you click OK to close the application module editor, the Web service is generated using the <appmod name>Server.java class created by making the application module remoteable.

There is a bug in JDeveloper 10.1.3.0 that results in JDeveloper hanging if you re-enter the application module editor to make any changes after you have generated a Web service (it is clicking OK - and therefore trying to regenerate the web service, that causes the hanging). To avoid this, the workaround is to delete the Web service (File -> Erase from Disk with the Web service node selected) and then open the editor to make any application module changes .
I'm expecting this to be fixed in Service Update 4.

You can read more about Web Services and Oracle ADF Business Components in the
Oracle Developer's Guide for Forms/4GL Users.