Access JAX-WS WebService from Java Class using Web Service Proxy in Jdeveloper

Sharing is Caring

Web Service proxy class is a way to communicate with XML-based WebService using SOAP format, In short, we can use service proxy class at the client to access WebService. In JDeveloper IDE we can easily create client proxy class for WebService, Here in this post I am creating client proxy class to access a JAX-WS web service that I have created in the previous blog post.
Create POJO based JAX-WS Web Service easily with JDeveloper 12.1.3

Let’s see how to implement this

    • Create a new Custom Application in JDeveloper IDE, Go to File — New — Application



    • Put name and package for application



    • Click on Finish to create an application



    • Right-click on the project and select from gallery Business Tier — Web Services — Web Service Client and Proxy. See the description it tells that client proxy is used to make a call to remote web service



    • Enter the Web Service URL and click on next



    • Click on Finish to create WS client proxy class



    • Now you can see all classes and configuration files are created by IDE itself



    • Now open EmployeesPortClient class and It looks like this, Accesses Employees Web Service



    • Here I am adding code to iterate over Employees list returned from Web Service

import java.util.ArrayList;

// This source file is generated by Oracle tools.
// Contents may be subject to change.
// For reporting problems, use the following:
// Generated by Oracle JDeveloper 12c
public class EmployeesPortClient {
public static void main(String[] args) {
EmployeesService employeesService = new EmployeesService();
Employees employees = employeesService.getEmployeesPort();
// Add your code to call the desired methods.
ArrayList<EmpBean> emp = (ArrayList) employees.getEmpList();
for (EmpBean empl : emp) {
System.out.println("Name- " + empl.getName());

Here getEmpList is the method of Web Service that returns a list of Employees
and output is

Sample ADF Application-Download
Cheers 🙂 Happy Learning

Related Posts

1 thought on “Access JAX-WS WebService from Java Class using Web Service Proxy in Jdeveloper”

  1. Hi Ashish,
    Thanks for blog.. i have created the same . Everything looks good.but i am facing in following scenario .. For example if service is not in working i am not able to deploy application. How do i overcome this dependency problm.

Leave a Reply

Your email address will not be published. Required fields are marked *