Friday 29 November 2013

Creating ADF Data Control for Web Services


This blog we will see how to create ADF data controls for web service.

The following steps need to follow for creating ADF data control for a web service.

Step-1:- Create a Fusion Web Application (ADF)
   

Step-2:- Right click on the project and select “New”. Select “Web service” in the left side tab then selects “Web Service Data Control (SOAP/REST)” then click “OK”.

Step-3:- Now you can give the “Name” and “URL” of the data control. (URL contains the wsdl of the service).

Step-4:- Click on “Next”. Then it will display all operations of the service. Now you need to select the operation for which you want to create data control.


Step-5:- Now click on “Next” then it will display all the selected operations. Now you can give the XSD URL and XSL URL for the selected operations.
Note:-  If the XSD URL and XSL URL exist then give else leave it blank.


Step-6:- Now click “Next”. Now it will display the Endpoint Authentication screen. Here you can give the user name and password (if exist) for the data control port.

Step-7:- Now click”Next” then click “Finish”. Now all the existing data control will create.

Now you can use the data controls in your UI screen.

You can download the code:Download
 
Thanks...

Saturday 23 November 2013

Exposing Web Services Using the ADF Model Layer


This blog we will see how to create a web service in ADF Model layer.

The following steps need to follow for creating a web service.

Step-1:- Create a Fusion Web Application (ADF).

Step-2:- Create a database connection.
 

Step-3:- Right click on the Project -- >Select ADF Business Components -- >Click on Business Components from Tables.

Step-4:- Create an entity object (For which table you want to create service).

Step-5:- Create view object for the same entity object.

Step-6:- Add the view object in application module.
 

Step-7:- Double click Application Module, select Service Interface and click on Add button.

Step-8:- Change the Web Service Name and the Target Namespace value if required. Select the check box “Generate Asynchronous Web Service Methods”.
 

Step-9:- Click Next -- >Next
Step-10:- Move the Available View Instance to the Selected Side and select the operations that need to be exposed via service.

Step-11:- Now the service is created. You can right click on Implementation class and run the service.

Step-12:- After running the Implementation class it will give the service URL.
Step-13:- Now you can test your service in HTTP Analyzer. You can click the URL.


Step-14:- You can enter the input for the service and click the “Send Request”. You will get the output from the service.
 

Step-15:- Now we will see how to create a custom method inside the service. Open the Application Module and click on “Java” tab then add java class.
 
Step-16:- Check the Application Module Implementation class then click “OK”.

Step-17:- Now open Application Module Implementation class and add the custom method.
    

public String getName(String name){
        return "You Entered "+name;
    }
 

Step-18:- Add the custom method in client interface.
Step-19:- Now open the Service Interface and click on the “Service Interface Custom method” and add the custom method in selected side.
Step-20:- Now you can run Service implementation class and test the service.

You can download the code:Download

Thanks...