Lets assume we have a WSDL file called as AreaService.wsdl
1:- AreaService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/AreaService/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AreaService" targetNamespace="http://tempuri.org/AreaService/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/AreaService/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="area" type="xsd:float"/>
<xsd:element name="parameters" type="tns:dimensions"/>
<xsd:complexType name="dimensions">
<xsd:sequence>
<xsd:element name="width" type="xsd:float"></xsd:element>
<xsd:element name="height" type="xsd:float"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="CalculateRectAreaResponse">
<wsdl:part element="tns:area" name="area"/>
</wsdl:message>
<wsdl:message name="CalculateRectAreaRequest">
<wsdl:part element="tns:parameters" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AreaService">
<wsdl:operation name="CalculateRectArea">
<wsdl:input message="tns:CalculateRectAreaRequest"/>
<wsdl:output message="tns:CalculateRectAreaResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AreaServiceSOAP" type="tns:AreaService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CalculateRectArea">
<soap:operation soapAction="http://tempuri.org/AreaService/NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AreaService">
<wsdl:port binding="tns:AreaServiceSOAP" name="AreaServiceSOAP">
<soap:address location="http://tempuri.org"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Follow below given step to expose this wsdl file as SOAP W/S using Apache Axis2.
Make sure you have WTP and Axis plug in Eclipse and also have Axis2 set up in your machine.
1- Create Dynamic Project
![Image1](https://shdhumale.files.wordpress.com/2020/07/image1-1.jpg)
![Image2](https://shdhumale.files.wordpress.com/2020/07/image2-1.jpg)
Click on Modify and select Axis2
![Image3](https://shdhumale.files.wordpress.com/2020/07/image3-1.jpg)
Click save and next
![Image4](https://shdhumale.files.wordpress.com/2020/07/image4-1.jpg)
![Image5](https://shdhumale.files.wordpress.com/2020/07/image5-1.jpg)
Click on Finish Button.
Now create new folder wsdl as shown below
![Image6](https://shdhumale.files.wordpress.com/2020/07/image6.png)
and click finish button.
Copy your wsdl in this wsdl folder
Now lets exposed this wsdl as webservice using following steps given below
Right Click on WSDL file --> Other --> Web Service--> Web Service
![Image7](https://shdhumale.files.wordpress.com/2020/07/image7-1.jpg)
![Image8](https://shdhumale.files.wordpress.com/2020/07/image8-1.jpg)
![Image9.1](https://shdhumale.files.wordpress.com/2020/07/image9.1.jpg)
Click on web service runtime:Apache Axis2
![Image9](https://shdhumale.files.wordpress.com/2020/07/image9-1.jpg)
![Image10](https://shdhumale.files.wordpress.com/2020/07/image10-1.jpg)
![Image11](https://shdhumale.files.wordpress.com/2020/07/image11.jpg)
Click on start server button and wait for server to start
![Image12](https://shdhumale.files.wordpress.com/2020/07/image12.jpg)
Now modify the response of the code generated from the wsdl so that we can get the desired output in this case we have file called AreaServiceSkeleton.java
Area objArea = new Area();
objArea.setArea(parameters.getParameters().getHeight()*parameters.getParameters().getWidth());
return objArea;
//throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#calculateRectArea");
![Image13](https://shdhumale.files.wordpress.com/2020/07/image13.jpg)
Now deploy the applicaiton on the server i.e. right click the project and select run as and tomcat and next and deploy
Now lets check our WSDL files exposed using this url
![Image14.1](https://shdhumale.files.wordpress.com/2020/07/image14.1.jpg)
![Image14](https://shdhumale.files.wordpress.com/2020/07/image14.jpg)
Click on service
![Image15](https://shdhumale.files.wordpress.com/2020/07/image15.jpg)
Now if you hover your mouser cursor on AreaService you will get the WSDL url copy it
http://localhost:8181/SiddhuExposedWsdl/services/AreaService?wsdl
We will use this to check if the service is working or not. To test the SOAP WS we are using SOAP UI tool
![Image18](https://shdhumale.files.wordpress.com/2020/07/image18.jpg)
![Image19](https://shdhumale.files.wordpress.com/2020/07/image19.jpg)
![Image20](https://shdhumale.files.wordpress.com/2020/07/image20.jpg)
1:- AreaService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/AreaService/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AreaService" targetNamespace="http://tempuri.org/AreaService/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/AreaService/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="area" type="xsd:float"/>
<xsd:element name="parameters" type="tns:dimensions"/>
<xsd:complexType name="dimensions">
<xsd:sequence>
<xsd:element name="width" type="xsd:float"></xsd:element>
<xsd:element name="height" type="xsd:float"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="CalculateRectAreaResponse">
<wsdl:part element="tns:area" name="area"/>
</wsdl:message>
<wsdl:message name="CalculateRectAreaRequest">
<wsdl:part element="tns:parameters" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AreaService">
<wsdl:operation name="CalculateRectArea">
<wsdl:input message="tns:CalculateRectAreaRequest"/>
<wsdl:output message="tns:CalculateRectAreaResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AreaServiceSOAP" type="tns:AreaService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CalculateRectArea">
<soap:operation soapAction="http://tempuri.org/AreaService/NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AreaService">
<wsdl:port binding="tns:AreaServiceSOAP" name="AreaServiceSOAP">
<soap:address location="http://tempuri.org"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Follow below given step to expose this wsdl file as SOAP W/S using Apache Axis2.
Make sure you have WTP and Axis plug in Eclipse and also have Axis2 set up in your machine.
1- Create Dynamic Project
![Image1](https://shdhumale.files.wordpress.com/2020/07/image1-1.jpg)
![Image2](https://shdhumale.files.wordpress.com/2020/07/image2-1.jpg)
Click on Modify and select Axis2
![Image3](https://shdhumale.files.wordpress.com/2020/07/image3-1.jpg)
Click save and next
![Image4](https://shdhumale.files.wordpress.com/2020/07/image4-1.jpg)
![Image5](https://shdhumale.files.wordpress.com/2020/07/image5-1.jpg)
Click on Finish Button.
Now create new folder wsdl as shown below
![Image6](https://shdhumale.files.wordpress.com/2020/07/image6.png)
and click finish button.
Copy your wsdl in this wsdl folder
Now lets exposed this wsdl as webservice using following steps given below
Right Click on WSDL file --> Other --> Web Service--> Web Service
![Image7](https://shdhumale.files.wordpress.com/2020/07/image7-1.jpg)
![Image8](https://shdhumale.files.wordpress.com/2020/07/image8-1.jpg)
![Image9.1](https://shdhumale.files.wordpress.com/2020/07/image9.1.jpg)
Click on web service runtime:Apache Axis2
![Image9](https://shdhumale.files.wordpress.com/2020/07/image9-1.jpg)
![Image10](https://shdhumale.files.wordpress.com/2020/07/image10-1.jpg)
![Image11](https://shdhumale.files.wordpress.com/2020/07/image11.jpg)
Click on start server button and wait for server to start
![Image12](https://shdhumale.files.wordpress.com/2020/07/image12.jpg)
Now modify the response of the code generated from the wsdl so that we can get the desired output in this case we have file called AreaServiceSkeleton.java
Area objArea = new Area();
objArea.setArea(parameters.getParameters().getHeight()*parameters.getParameters().getWidth());
return objArea;
//throw new java.lang.UnsupportedOperationException("Please implement " + this.getClass().getName() + "#calculateRectArea");
![Image13](https://shdhumale.files.wordpress.com/2020/07/image13.jpg)
Now deploy the applicaiton on the server i.e. right click the project and select run as and tomcat and next and deploy
Now lets check our WSDL files exposed using this url
![Image14.1](https://shdhumale.files.wordpress.com/2020/07/image14.1.jpg)
![Image14](https://shdhumale.files.wordpress.com/2020/07/image14.jpg)
Click on service
![Image15](https://shdhumale.files.wordpress.com/2020/07/image15.jpg)
Now if you hover your mouser cursor on AreaService you will get the WSDL url copy it
http://localhost:8181/SiddhuExposedWsdl/services/AreaService?wsdl
We will use this to check if the service is working or not. To test the SOAP WS we are using SOAP UI tool
![Image18](https://shdhumale.files.wordpress.com/2020/07/image18.jpg)
![Image19](https://shdhumale.files.wordpress.com/2020/07/image19.jpg)
![Image20](https://shdhumale.files.wordpress.com/2020/07/image20.jpg)