Shay Shmeltzer's Oracle Development Tools Tips

  • September 11, 2009

Web Services with Complex Data Types in ADF 11g

Shay Shmeltzer
Director of Product Management - Oracle

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

Join the discussion

Comments ( 14 )
  • Andreja Thursday, September 17, 2009
    I have a problem. When I drag return attribute to the page then web service is called on page load.
  • shay Thursday, September 17, 2009
    You'll need to check the refresh condition assign to the WS execution in the page binding.
    This solution might help:
  • anyone Monday, October 19, 2009
    Hi Shay,
    from an architecture point of view I would never use the WS-DataCorntol directly. I suggest to use a WS-ClientProxy generator like CXF, AXIS, Oracle, ... and use the POJO-Datacontroll. If you connect the DC directly against WS you can't use all WS-standards like, SAML with Kerberos, WS-Adressing, WS-Reliability etc.
    Furthermore, in a more complex szenario we found a lot of pitfalls where we was unable to solve with the current WS-DC implementation.
    - che
  • shay Monday, October 19, 2009
    I agree that using the Java client proxy generation capability in JDeveloper to create a Java class that invokes the Web service, and then expose that class as a data control is potentially a more powerful and flexible combination.
    But sometime the quick and dirty way that the Web service data control offers is a good enough solution.
  • anonymous Thursday, December 17, 2009
    Hi Shay, I was googling for a long time for this information. This is one is great. It gave me exactly what I was looking for. Thanks so much.
  • Kamleshwar Thursday, January 20, 2011
    The link in the following statement is taking somewhere else. Could please check?
    This tutorial shows how to build an ADF 11g client using complex data types.
  • shay.shmeltzer Friday, January 21, 2011
    Thanks for the note - I updated the link - and added a couple of others at the end with a bit of more samples.
  • guest Monday, June 13, 2011
    It's a much usefull link..thanks shay..
  • guest Monday, June 13, 2011
    I created a JSF page from a WS data control and successfully posting the request and got the result back.But the content is not displaying on the JSF page. i used output read only form to display the result. please suggest.
  • Shay Monday, June 13, 2011

    guest, It is hard to say what you have done wrong without more details - I would suggest that you post your question on the JDeveloper forum on OTN with a bit more details. You can use the HTTP Analyzer in JDeveloper and debugger to see the messages to your web service and the values in your binding layer.

  • Darren Thursday, August 25, 2011

    Hi Shay,

    I'm new to ADF and loving your video tutorials.

    In my case, I am using a street address search web service which takes 3 input params (2 of which I'd like to hard code and not provide text input boxes for) and which returns an array of objects - each object containing an array of strings comprising a single street address (i.e. street number, street name, suburb, zip code). I would like to format each string array as a comma separated string in a list box so that the user may select one single address. Is this even possible with just ADF drag-and-drop features? I'm not having much luck so far. Is it more complex and requires additional logic?

    Many thanks,


  • Shay Thursday, August 25, 2011


    My guess is that you'll be better of using a Java class proxy that invokes your web service, and then formats the returned object to the way you want to show it on the screen.

    Then you can expose this proxy class as an ADF Data control - and drag the method and formatted result into the page.

  • guest Friday, August 26, 2011

    Thanks Shay. Do you have any tutorials that show how to expose a proxy class as an ADF control in jDeveloper?

    Thanks again,


  • guest Saturday, September 14, 2013

    Hi Shay,This is very helpful.I have a question.If the webservice taking inputs as both object and string i.e. if it takes two params,can i drag and drop the second parameter in the form(object dragged as form),how can i do that...If you have any resources helpful for dealing with webservice datacontrols in detail..Could you please share ....

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.