Wednesday, July 28, 2010

Invoking Web Services in Oracle ADF

There are two ways to invoke a Web Service in an ADF Application:
1. JAX-WS Proxy
2. Web Service Data Control

JAX-WS Proxy
Just by providing the wsdl to the Create WebService Proxy wizard you can easily generate the proxy to invoke the webservice. More details on this can be found on my earlier post.
Pros:
Gives more flexibility and control to the WebService consumer. The developer can create webservice request object and can invoke the webservice as required. The proxy can also be wrapped as a DataControl (right click on the client java file and select Generate Data Control) and used in ADF.
Cons:
Maintanence is hard. Generates many files to support the proxy and the proxy has to be regenerated if the WSDL stucture changes.

Web Service Data Control
In the New Gallery select Web Service Data Control and provide the wsdl location in the wizard to generate the Data Control. Once the DataControl is generated it can be used on like any other datacontrol and the webservice's operations can be performed in ease. For eg, a button click on a page / method on taskflow.
Pros:
Easy to create and use.
Cons:
Limited control over invoking the webservice.

No comments: