Updating an ADF Web Service Data Control When Service Structure or Location Change

The web service data control in Oracle ADF gives you a simplified approach to consuming services in ADF applications, and now with ADF Mobile the usage of this service seems to be growing.

A frequent question we get is what happens if the service that I'm consuming changes - how do I update my data control?

Well, first we should mention that if you do a good design of your application before you actually code - then things like Web service method signature shouldn't change. The signature is the contract between the publisher and the consumer, and contracts shouldn't be broken.

But in reality things do change during development stages, so here is how you can update both method signatures and service location with the Web service data control:

After watching this video you might be tempted to not copy the WSDLs to your project - which lets you use the right click update on a data control. However there is a reason why the copy is on by default, it reduces network traffic when you are actually running your application since ADF doesn't need to go to the server to find out the service structure. So for runtime performance, you probably should keep the WSDL local.

 I encourage you to further look into both the connections.xml file where your service location is saved, and the datacontrols.dcx file where its definition is kept to get an even deeper understanding of how ADF works underneath the declarative layers.


Comments:

Thanks!

Posted by simo on December 20, 2012 at 05:32 PM PST #

Thanks for the informaition Shay. But i think there are some differences in adf mobile. We cant update DC by left clicking and update way or when we add some extra feature(update , find , any other) to wsdl and then try to update , we cant see the new features in the wsdl.

Posted by guest on January 03, 2013 at 06:05 AM PST #

hi,
is it possible to create view links for web service data controls
if yes how.
thanks in advance

Posted by guest on February 13, 2013 at 12:10 AM PST #

You'll be able to use view links if you wrap the access to the Web services with programmatic view objects.
Note though that Web services can return complex nested values and the WS data control knows to handle this.

Posted by Shay on February 14, 2013 at 11:02 AM PST #

Shay,

I'm not sure if you're aware of this, but when you build additional view criteria in the BC service and you try to "UPDATE" the WC DC it doesn't allow you to select the new view criteria methods. Is this a bug or is there a different way to go around it?

Posted by Kyle T. on April 24, 2013 at 10:09 AM PDT #

Kyle - did you update the AM Service Facade to include the new view criteria you added? This should then update the WSDL which you should then be able to pick up with the WS data control.

Posted by Shay on April 24, 2013 at 12:41 PM PDT #

I did.

When I deployed my updated service to the server I can access it and invoke the methods just fine.

When I try to create a new WS DC and it asks to update my wsdl none of the new View Criteria methods come across.

I'll see if I can creat a test case using the HR schema.

Posted by guest on April 24, 2013 at 01:12 PM PDT #

I am new to ADF, could you please elaborate more on this?

"You'll be able to use view links if you wrap the access to the Web services with programmatic view objects.
Note though that Web services can return complex nested values and the WS data control knows to handle this."

I am consuming two REST JSON-xml web service in my ADF. I am trying to create a view link between these two in the Data Control to make it look like master-detail relation. Could you please give an example of how to do it.
Thanks a lot.

Posted by guest on May 10, 2013 at 08:55 AM PDT #

guest - you can read more about using ADF BC VOs as wrappers for Web services here:
http://www.oracle.com/technetwork/issue-archive/2012/12-jul/o42adf-1653060.html
And in the ADF Documentation too.

Posted by Shay on May 10, 2013 at 10:31 AM PDT #

Hi Shay,

Does this work the same for ADF projects generated to work with SOA or BPM Human Tasks? We're having trouble getting our web service data controls to update to include the new operations we have added. What version of JDeveloper were you using for this?

Thanks.

Posted by Dave B on June 21, 2013 at 12:55 PM PDT #

Dave, this will work for the web service data control - I think the BPM data control is a different implementation - so you should ask on their forum how you can achieve the same.

Posted by guest on June 21, 2013 at 03:17 PM PDT #

Shay,

I put together a simple demo using the HR schema running locally on 11.1.2.4.

https://docs.google.com/file/d/0B4_rCR8y7GmbTkI0Qk81VENub1U/edit?usp=sharing

I created/ran my web service that was built exposing the ADF BC as a service interface. I created a simple mobile app that uses the web services data control (1 with no copy of the WSDL and one with copy of the WSDL).

I then went back into the web service and added another view criteria (getEmpBySalary) and ran it locally. I went back into the mobile application and right-clicked on the _wCopy in the DataBinding and it modifies the DataBindings (Because I have to SAVE) but it doesn't update the methods.

Let me know what you think.

Posted by guest on June 24, 2013 at 03:23 PM PDT #

Shay,

Disregard that last message. It was a small mistake I made on my part. I was trying to update the DataControl that had a copy of the WSDL locally on the machine. When I recreated the DataControl my updated / new methods came across fine.

Posted by Kyle T. on June 28, 2013 at 01:08 PM PDT #

I'm experimenting with using web service data controls.
How would I add code that gets called before and after every webs service data control is invoked (i.e for performance monitoring). Also where is the end point configured? There are different service URLS's for each environment (dev, qa, productions, etc.. ). Also how to I catch web service errors to present a user friendly message instead of letting ADF display a cryptic error to the user if the call fails due to communication issue or other server issue.

Posted by Don K on August 26, 2013 at 10:47 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today