Web Services with Complex Data Types in ADF 11g
By Shay Shmeltzer-Oracle on Sep 11, 2009
A guest post by Srikant Subramaniam from our Fusion Middleware for Apps product management group.
The Web Service Data Control
The Web Service Data Control in ADF 11g provides an easy and convenient interface to incorporate web services in an ADF application. The data control abstracts the implementation of a business service (such as a web service) thus providing a consistent mechanism for the ADF pages to access the data.
While most of the simple samples out there will show you how to invoke a Web service that returns a simple string, there are some specific things you need to know when you are working with complex data types.
Complex Data Types
A complex data type wraps a number of attributes, such as an array of objects. For instance, the request object for the "getObject" operation contains an array of individual attributes as shown below:
Similarly, the response object can also contain several individual attributes:
In JDeveloper 10.1.3 there was no out-of-the-box support for complex data types, hence the inability to drag and drop only the relevant input/output attributes onto the JSF page when designing the ADF UI.
As a result, we had the following workarounds:
1. For complex input parameters, create an instance of the complex input type in a managed bean and add it to the parameter map of an Oracle ADF operation binding that invoked the web service, as described here.
2. For complex return types, either via the use of web service data control; or a web service proxy, as described here.
While these workarounds were fully functional, they introduced the need for custom Java coding/development.
This has changed with JDeveloper and ADF 11g, and complex data types are now supported out-of-the-box, creating an ADF client does not require any custom Java coding and is accomplished via drag/drop style data binding of the complex data types.
This tutorial shows how to build an ADF 11g client using complex data types.
[update June 2010] Frank has a good sample about complex type parameters and how you can leverage ADF binding to set properties of them here: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/54-ws-complex-input-type-169197.pdf
Another example that might be useful here - http://blogs.oracle.com/shay/2010/05/updateinsert_with_adf_web_serv.html