Web Services
Web Services
Web Services
The concept of services is not new—RMI, COM, and CORBA are all service-oriented
technologies. However, applications based on these technologies require them to be
written using that particular technology, often from a particular vendor. This
requirement typically hinders widespread acceptance of an application on the Web.
Web services represent a new standard based and simplified model for creating and
connecting distributed applications across the web in the form of services. While web
services are still maturing customers may begin to start development without
significant new investment given the burgeoning growth application server software.
Web services is a technology that allows applications to communicate with each other
in a platform- and programming language-independent manner. A Web service is a
software interface that describes a collection of operations that can be accessed over
the network through standardized XML messaging. It uses protocols based on the
XML language to describe an operation to execute or data to exchange with another
Web service. A group of Web services interacting together in this manner defines a
particular Web service application in a Service-Oriented Architecture (SOA).
The software industry is finally coming to terms with the fact that integrating
software applications across multiple operating systems, programming languages,
and hardware platforms is not something that can be solved by any one particular
proprietary environment. Traditionally, the problem has been one of tight-coupling,
where one application that calls a remote network is tied strongly to it by the
function call it makes and the parameters it requests. In most systems before Web
services, this is a fixed interface with little flexibility or adaptability to changing
environments or needs.
Web services uses XML that can describe any and all data in a truly platform-
independent manner for exchange across systems, thus moving towards loosely-
coupled applications. Furthermore, Web services can function on a more abstract
level that can reevaluate, modify or handle data types dynamically on demand. So,
on a technical level, Web services can handle data much easier and allow software to
communicate more freely.
On a higher conceptual level, we can look at Web services as units of work, each
handling a specific functional task. One step above this, the tasks can be combined
into business-oriented tasks to handle particular business operational tasks, and this
in turn allows non-technical people to think of applications that can handle business
issues together in a workflow of Web services applications. Thus, once the Web
services are designed and built by technical people, business process architects can
aggregate them into solving business level problems.
To borrow a car engine analogy, a business process architect can think of putting
together a whole car engine with the car frame, body, transmission, and other
systems, rather than look at the many pieces within each engine. Furthermore, the
dynamic platform means that the engine can work together with the transmission or
parts from other car manufacturers.
What rises from this last aspect is that Web services are helping to bridge the gap
between business people and technologists in an organization. Web services make it
easier for business people to understand technical operations. Business people can
describe events and activities and technologists can associate them with appropriate
services.
With universally defined interfaces and well-designed tasks, it also becomes easier to
reuse these tasks and thus, the applications they represent. Reusability of application
software means a better return on investment on software because it can produce
more from the same resources. It allows business people to consider using an
existing application in a new way or offering it to a partner in a new way, thus
potentially increasing the business transactions between partners.
Therefore, the primary issues that Web services tries to tackle are the issues of data
and application integration, and that of transforming technical functions into
business-oriented computing tasks. These two facets allow businesses to
communicate on a process or application level with their partners, while leaving
dynamic room to adapt to new situations or work with different partners on demand.
Web Services represent a new standard-based and simplified model for creating and
connecting distributed applications across the web in the form of services. Web
Services are built on the top of existing and widely adopted Internet protocols such
as HTTP, XML, TCP/IP, HTML, Java and XML. This means the base foundation for
building the Web Services is already in place. From a more technical perspective,
Web Services are XML depictions of objects, messages, and documents designed to
interact over the web to enable application integration. Web Services applications can
be published found or invoked as atom like services anywhere ion the Internet thus
creating service grid of dynamic business components.
• SOAP (Simple Object Access Protocol) defines the XML based message format
that applications use to communicate and inter-operate with each other over the
Internet. The heterogeneous environment pf the Internet demands that applications
support a common data encoding protocol and message format. SOAP is a protocol
for initiating conversations with a UDDI service. SOAP makes object access simple by
allowing applications to invoke object methods, or functions, residing on remote
servers. A SOAP application creates a request block in XML, supplying the data
needed by the remote method as well as the location of the remote object itself.
• WSDL (Web Service Description Language), the proposed standard for how a
Web service is described, is an collection of metadata about XML-based service used
for describing what business do and how to access their services electronically. We
can cay WSDL is a XML- Based service IDL (Interface Definition Language) that
defines the service interface and its implementation characteristics. WSDL is
referenced by UDDI entries and describes the SOAP messages that define a
particular Web service.
• A definition of the format of the messages that are passed between two endpoints
using its <types> and <message> elements and appropriate schema definitions.
• The semantics of the service: how it might be called to make a synchronous
request/reply, synchronous reply-only or asynchronously communicate.
• The end point and transport of the service via the <service> element: that is, who
provides the service.
• An encoding via the <binding> element, that is how the service is accessed.
A WSDL example
<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol" type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice">
<complexType>
<all>
<element name="price" type="float"/>
</all>
</complexType>
</element>
</schema>
</types>
<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body" element="xsd1:TradePrice"/>
</message>
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>
<service name="StockQuoteService">
<documentation>My first service</documentation>
<port name="StockQuotePort" binding="tns:StockQuoteBinding">
<soap:address location="http://example.com/stockquote"/>
</port>
</service>
</definitions>
A SOAP example
POST /StockQuote HTTP/1.1
Host: www.stockquoteserver.com
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: "http://example.org/2001/06/quotes"