Posts

Showing posts from March, 2017

Invoke SOAP web service using Client Jars(wsimport command)

Image
Step 1 : Open Command prompt(Windows + R + Enter) and traverse to folder for downloading client jars. e.g : D:\Development\Soap. Step 2: Run below mentioned command: wsimport -clientjar soapService.jar http://localhost:8080/SOAPWebSErvice/services/EmployeeController?wsdl wsimport – To download cient jar/source code on local machine. -clientjar – To bundle all the jars and source code into a single bundle. soapService.jar - Jar file name. http://localhost:8080/SOAPWebSErvice/services/EmployeeController?wsdl – WSDL url where service is deployed. Step 3: Create New Java Project and add SoapClient.java file as below : package com.client; import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.Service; import com.test.controller.EmployeeController; import com.test.model.Employee; public class SoapClient { public static void main(String[] args) throws Exception { final URL url = new URL("http://localhost:8080/SOAPWebSErvice/servic...

Steps to create SOAP Web service using Eclipse

Image
Step 1 : Go to File -> New -> Dynamic Web Project Step 2 : Enter Project name as “SOAPWebSErvice” as created in below screenshot. Step 3 : Create below packages under src folder: a. com.test.controller b. com.test.model Step 4 : Add Employee.java under package - com.test.model Add EmployeeController.java under package - com.test.controller. Employee.java package com.test.model; public class Employee { private String id; private String name; public String getId() { return id; } public String getName() { return name; } public void setId(String id) { this.id = id; } public void setName(String name) { this.name = name; } } ------------------------------------------------------------------------------------------------------------------ EmployeeController.java package com.test.controller; import com.test.model.Employee; public class EmployeeController { public Employee employee; public Employee setEmployee(...