java2db

How to call a web service from another web service (web service chain)



Call a web service from another web serviceSteps to call a web service from another web service :

 

 Below example ,we used Eclipse IDE , GlassFish server.

 

 

Call a web service from another web service  Step 1 :  Create a dynamic web project (in our example webServiceChaining ). and create a web service class under any valid package (Ex : student/Student_details.java).

 

 

 

Call a web service from another web service  Step 2 : Copy the below code to Student_details.java file .

 

 

 

 

Call a web service from another web service  Step 3 : Create another dynamic web project  (webServiceChainingChild) and create a web service class Student_marjs.java in any valid directory (Ex : marks/Student_marjs.java ).

 

Java Web Services

 

 

 

 

  Step 4 :  Copy the below code to Student_marks.java file.

 

 

 

 

  Step 5: Now , generate client under for Student_marjs.java under webServiceChaining  project by using WSDL file .(See the example to generate client here)

 

Java Web Services

 

 

 

 

  Step 6 : So the entire directory structures below .

 

Java Web Services

 

 

 

 

  Step 7 : Deploy both the web projects (Create new Enterprise Application Project and add the two dynamic web projects to it) in any web/application server (in our example we user GlassFish server).

 

Java Web Services

 

 

 

 

  Step 8 : Test the application from SoapUI (you can test the service using any testing tool) , the response comes like below.

 

Java Web Services




Related Posts :
How to create WCF web service in C# .NET ( visual studio 2013 )
How to call java SOAP web service in php ( php web service client )
What is RESTful web service (Introduction to RESTful web services)
How to provide security to SOAP web services ( JAX-WS )
How to handle custom exceptions using SOAP faults in web services
How to Create a java web service using bottom up approach
Create a java web service from WSDL (Top down approach) in Eclipse
Top down and Bottom up approach ( java web service )
   [will not be published]



^ <