o
Web Service: a software system designed to support interoperable machine-to-machine interaction over a network.
the interface (contract) of communication is called WSDL.
Web Services Architecture
Service Registry:An registry which maintains the list of service providers.
Service Provider:The one which provides the service.
Service Requestor: The one which requests the service which is the client.
the service requestor or the client sends a SOAP request in an HTTP/SNMP/UDP packet and at the service provider
side the SOAP request is extracted from the packet and interpreted.
Top – Down / Bottom Up Approaches
In top-down approach wsdl is written first and then the java code is generated and implemented.
in bottom-up approach java code is written first and then the wsdl is generated for the same.
Web services with eclipse
eclipse plugin to install: http://axis.apache.org/axis2/java/core/tools/index.html axis2-eclipse-codegen-plugin
downlaod and extract to plugins folder of eclipse.
WSDL- web services description Language.
Hello world web services using Eclipse and axis2 plug in.
Web Service: a software system designed to support interoperable machine-to-machine interaction over a network.
the interface (contract) of communication is called WSDL.
Web Services Architecture
![clip_image001[10] clip_image001[10]](http://lh4.ggpht.com/_VSun5JQ0LC8/TbJr-6syiMI/AAAAAAAAH8Q/K_JVEtsNbIk/clip_image001%5B10%5D_thumb%5B2%5D.gif?imgmax=800)
Service Registry:An registry which maintains the list of service providers.
Service Provider:The one which provides the service.
Service Requestor: The one which requests the service which is the client.
the service requestor or the client sends a SOAP request in an HTTP/SNMP/UDP packet and at the service provider
side the SOAP request is extracted from the packet and interpreted.
Top – Down / Bottom Up Approaches
In top-down approach wsdl is written first and then the java code is generated and implemented.
in bottom-up approach java code is written first and then the wsdl is generated for the same.
Web services with eclipse
eclipse plugin to install: http://axis.apache.org/axis2/java/core/tools/index.html axis2-eclipse-codegen-plugin
downlaod and extract to plugins folder of eclipse.
WSDL- web services description Language.
- describes a web service
- is an xml
- is a w3c standard http://www.w3.org/TR/wsdl
- Service : is a collection of network endpoints, or ports.
- Binding : the communication protocol used along with the data format specification.
- Port Type :collection of abstract operations.
- Messages : the data being exchanged.
- Types : has the data types used by the web service.
- Operation : description of the operation supported by the service.
- Port : endpoint which is a combination of a binding port and a network address
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions>
<wsdl:types>
</wsdl:types>
<wsdl:message name="messageName">
</wsdl:message>
<wsdl:portType name="portName">
</wsdl:portType>
<wsdl:binding name="soapBinding" type="impl:portTypeName">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/protocol"/>
</wsdl:binding>
<wsdl:service name="serviceName">
<wsdl:port binding="soapBinding" name="HelloWorld">
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
WSDL supports four types of operations { one-way , request-response , solicit-response , notification }
<soap:binding transport indicates the protocol used for sending the soap request
http,snmp,smtp,ftp etc.
- create a new project with name HelloWebService
- write a simple Java Class
public class HelloImpl {
// says hello
public String sayHello() {
return "Hello world";
}
// adds two numbers
public int addNumbers(int a, int b) {
return a + b;
}
}
- Right click on the above class file, select –> Web Services –> Create Web Service
- and select test Service from the panel, which will create the webservice as well as test the service.
- the server runtime can be used to select the application/web server and click next.
6. Select the methods of the java class to be exposed as webservice operations in this case , sayHello and addNumbers operations
![]()
7. Start the server clicking the start button in the next window and then click next.
8. click next and Finish, which will open the Web services Explorer
Amazing web services......
ReplyDeleteWeb Designing in India
Nice post,Thanks for sharing.It contains important information.
ReplyDeleteWebsite Company Toronto