The document discusses web services and related technologies. It defines web services as applications that communicate over HTTP using XML, SOAP, WSDL and UDDI standards. Web services can be combined to deliver complex operations. Common uses include reusable application components and connecting existing software. Key elements discussed include SOAP for XML messaging, WSDL for describing service interfaces, and REST as an architectural style using HTTP methods like GET and POST. The document also provides examples of how to implement SOAP and REST web services using Java technologies.
3. What is Web Service?
Web services are client and server applications that
communicate over the World Wide Web’s (WWW) HyperText
Transfer Protocol (HTTP).
A way of integrating Web-based applications using the
XML, SOAP, WSDL and UDDI open standards over an Internet
protocol backbone.
Web services can be combined in a loosely coupled way to
achieve complex operations.
Programs providing simple services can interact with each
other to deliver sophisticated added-value services.
4. Uses of Web Services
Reusable Application Components
Connect Existing Software
5. Free Web Services Site
http://www.ezzylearning.com/services/
http://www.webservicex.net/WS/wscatlist.aspx
http://www.gisgraphy.com/free-access.htm
http://www.geonames.org/
8. SOAP
Simple Object Access Protocol (SOAP) is a standard
protocol specification for message exchange based on XML.
Communication between the web service and client
happens using XML messages.
SOAP defines the rules for communication like what are all
the tags that should be used in XML and their meaning.
9. Apache CXF
Open Source Services Framework
Build and develop services using frontend programming
APIs, like JAX-WS and JAX-RS.
This Services run on different protocols
SOAP, XML/HTTP, RESTful HTTP, or CORBA
Work on different transports HTTP, JMS or JBI.
10. What is WSDL?
WSDL stands for Web Services Description Language.
WSDL is a language for describing web services and
how to access them.
WSDL is written in XML.
WSDL definition describes how to access a web
service and what operations it will perform.
11.
12. WSDL Elements
Types– a container for data type definitions using some type
system (such as XSD).
Message– an abstract, typed definition of the data being
communicated.
Operation– an abstract description of an action supported by
the service.
Port Type–an abstract set of operations supported by one or
more endpoints.
Binding– a concrete protocol and data format specification for
a particular port type.
Port– a single endpoint defined as a combination of a binding
and a network address.
Service– a collection of related endpoints.
13. How to implement SOAP Web service?
Interfaces & its Implementations
@WebService
public interface ServiceName {
public String serviceMethod1();
public int serviceMethod2(args);
}
@WebService(endpointInterface = " *.Service")
public class ServiceImpl implements Service{
@Override
public String serviceMethod1() {…....}
@Override
Public int serviceMethod2(args){.......}
}
15. REST
REST is a client-server architecture which (among other things)
leverages the full capacity of the HTTP protocol.
RESTful webservices use HTTP methods explicitly by mapping
the REST operations to HTTP methods:
Create - POST
Retrieve - GET
Update - PUT
Delete - DELETE
16. WADL
The Web Application Description Language (WADL) is a
machine-readable XML description of HTTP-based web
applications (typically REST web services).
WADL models the resources provided by a service and the
relationships between them.
WADL is intended to simplify the reuse of web services that
are based on the existing HTTP architecture of the Web.
17. Implementation of REST Web service
Service Beans(Class as a Resource)
@Path(“rest”)
Class Resource
{
@GET
@Produces("text/plain")
Public String method1()
{….....}
@GET
@Consumes("application/json")
Public Response method2 ()
{ …....}
}