WebServices

fishnibblersspongyDéveloppement de logiciels

14 déc. 2013 (il y a 3 années et 8 mois)

57 vue(s)

Web
-
Services


Goals of this chapter


Provide an overview on most recent
technologies


Illustrate the importance of XML


Allow students to understand the
interconnections of the technologies


Allow students to see interconnections with
web
-
based architectures


Allow students to estimate future development


Web Services


What Is an XML Web Service?


XML Web services are the fundamental building blocks
in the move to distributed computing on the Internet.


Open standards and the focus on communication and
collaboration among people and applications have
created an environment where XML Web services are
becoming the platform for application integration.


Applications are constructed using multiple XML Web
services from various sources that work together
regardless of where they reside or how they were
implemented.


Examples: Transaction handling, calendar service, …

Web Services Introduction

(
http://e
-
serv.ebizq.net/wbs/thomas_1.html)


Web services have become influential since about 2002


Strong impetus for development of both major enterprise
platforms:


.NET (Microsoft)


J2EE (Sun Microsystems)


Users, e.g.:


U.K. government: Employs web services in creating an Internet
-
based
infractructure for all government services by 2005.


Software vendors such as Sun, Oracle Corp., are including web
services protocols in their platform and development tools.


Microsoft is planning to offer public web services, notably .NET
Passport that lets you use your email address and a single password for
secure sign
-
on to any participating web site.

Web Services
-

Trends


Three waves of web service deployment
:


Partner
: support complex supply chains


Private
: Web service protocols used to extend internal
EAI (Enterprise Application Integration) efforts.

Dominant mode of deployment will be mixed J2EE
and .NET, hence interoperability is essential


Public
: full
-
blown adoption of services; will be delayed
until standards are finalized.


Web services offer a fine
-
grained approach to EAI and
thus provide attractive means for companies who want to
outsource just few particular functions.

Web Services


Definition (one of several!)


XML Web Services expose useful functionality to
Web users through a standard Web protocol. In most
cases, the protocol used is SOAP.


XML Web services provide a way to describe their
interfaces in enough detail to allow a user to build a
client application to talk to them. This description is
usually provided in an XML document called a Web
Services Description Language (WSDL) document.


XML Web services are registered so that potential
users can find them easily. This is done with
Universal Discovery Description and Integration
(UDDI).


What can one do with web
services?


Exposing existing applications as XML Web services will
allow users to build new, more powerful applications that
use XML Web services as
building blocks
.


For example, a user might develop a purchasing
application to automatically obtain price information from
a variety of vendors, allow the user to select a vendor,
submit the order and then track the shipment until it is
received.


The vendor application, in addition to exposing its
services on the Web, might in turn use XML Web
services to check the customer's credit, charge the
customer's account and set up the shipment with a
shipping company.

Web Services


Easier than CORBA and DCE


Significant advantage over previous
efforts: web services work with standard
Web protocols

XML, HTTP and TCP/IP


Most of the information provided by web
services is available now on the Web, but
XML Web services will make
programmatic access to it easier and more
reliable.

SOAP


SOAP is the communications protocol for XML
Web services.


SOAP is a specification that defines the XML
format for messages.


SOAP message: a well
-
formed XML fragment
enclosed in a couple of SOAP elements.


The Current SOAP standard assumes security is
a transport issue and is silent on security issues.

SOAP


Optional parts of the SOAP specification
describe how to represent program data as XML
and how to use SOAP to do Remote Procedure
Calls.

They are used to implement RPC
-
style
applications where a SOAP message containing
a callable function, and the parameters to pass
to the function, is sent from the client. The server
returns a message with the results of the
executed function.


Most current implementations of SOAP support
RPC applications.

SOAP
(continued)


SOAP also supports document style applications
where the SOAP message is just a wrapper
around an XML document. Document
-
style
SOAP applications provide flexibility for many
new XML Web services.


The last optional part of the SOAP specification
defines the format of an HTTP message that
contains a SOAP message.


The HTTP binding is optional, but almost all
SOAP implementations support it because it's
the only standardized protocol for SOAP.


Web Services Description
Language WSDL


WSDL file: XML document describing a set of SOAP
messages and how they are exchanged.


WSDL is to SOAP what IDL is to CORBA or COM.


Since WSDL is XML, it is readable and editable but in
most cases, it is generated and consumed by software.


WSDL specifies what a request message must contain
and what the response message will look like in an
unambiguous notation.


A WSDL file defines everything required to write a
program to work with an XML Web service.


WSDL


The WSDL notation is based on the XML Schema
standard:


It is programming
-
language neutral and standards
-
based.


It is suitable for describing XML Web services interfaces that are
accessible from a wide variety of programming languages.


In addition to describing message contents, WSDL
defines where the service is available and what
communications protocol is used to talk to the service.


There are several tools available to read a WSDL file
and generate the code required to communicate with an
XML Web service.


Many current SOAP toolkits include tools to generate
WSDL files from existing program interfaces, but
currently there are few tools for writing WSDL directly.

WSDL Document Structure


A WSDL document is made up of 5 sections.


The WSDL document can be divided into two
groups of sections.


The top group is comprised of Abstract Definitions,


The
abstract

sections define SOAP messages in a platform
-

and language
-
independent manner; they do not contain any
machine
-

nor language
-
specific elements. This helps define a
set of services that several, diverse Web sites can
implement.


The bottom group consists of Concrete Descriptions.


Site
-
specific

matters such as serialization are then relegated
to the bottom sections, which contain concrete descriptions.

WSDL Document Structure

http://msdn.microsoft.com/library/default
.asp?url=/library/en
-
us/dnwebsrv/html/wsdlexplained.asp



Abstract Definitions



Types

Machine
-

and language
-
independent type definitions.


Messages

Contains function parameters (inputs separate from
outputs) or document descriptions.


PortTypes

Refers to message definitions in Messages section to
describe function signatures


Concrete Descriptions



Bindings


Specifies binding(s) of each operation in the PortTypes
section.


Services

Specifies port address(es) of each binding.


Universal Discovery Description
and Integration
-

UDDI


UDDI a
llows one to search for a company that offers the services
one needs, read about the service offered and contact someone for
more information.


A UDDI directory entry is an XML file that describes a business and
the services it offers. There are three parts to an entry in the UDDI
directory.



The "white pages" describe the company offering the service: name,
address, contacts, etc.


The "yellow pages" include industrial categories based on standard
taxonomies such as the Standard Industrial Classification.


The "green pages" describe the interface to the service in enough detail
for someone to write an application to use the Web service.



Services are defined through a UDDI document called a Type Model
or tModel. In many cases, the tModel contains a WSDL file that
describes a SOAP interface to an XML Web service.

What's Left?


SOAP, WSDL, and UDDI constitute a set of baseline
specifications that provide the foundation for application
integration and aggregation. From these, companies are
building real solutions and getting real value from them.


Today, people are having success with XML Web
services, but there are still things that are left, e.g.
security, operational management, transactions, reliable
messaging.


The Global XML Web Services Architecture will help
take XML Web services to the next level by providing a
coherent, general purpose model for adding new
advanced capabilities to XML Web services which is
modular and extensible.

Web Services and Distributed Objects:
Competing or Complementary?

(
http://e
-
serv.ebizq.net/wbs/conway_1.html)


The premise is that, when used correctly, Web services
and distributed objects have different paradigms
--
"document
-
oriented" and "object
-
oriented"
--
and that a
combination of both paradigms is required to achieve
end
-
to
-
end business integration.


The object
-
oriented platforms CORBA and J2EE have
been successful for building and integrating applications
within

the enterprise
.


The document
-
oriented XML technologies associated
with Web services are rapidly gaining popularity for
business
-
to
-
business integration
between

enterprises
.


Total business integration needs to address both these
areas.

Object
-
Oriented vs. Document
-
Oriented


Web services look like yet another
distributed object system. It is tempting to
expose existing CORBA or Java objects
as Web services by mapping them to
WSDL.


However, XML is document
-
oriented, not
object
-
oriented. Web services should
implement
document exchange systems

and not distributed object systems.


Object
-
Oriented vs. Document
-
Oriented


Document exchange systems have:


Larger, richer data structures
--
so much richer that we
call them "documents"


Looser coupling between agents


More asynchronous communication


Communicating objects have:


Simple data structures


Tight coupling


Synchronous communication:

Because of the tight
coupling one must be able to associate replies with
requests.


Web Services and Distributed Objects

Design Issues


Distributed object platforms are the ideal underpinning
for a Web service.


Some of the distributed objects have to be designed with
the knowledge that they are going to be Web services.
These "service objects" will typically delegate their work
to many smaller
-
grained distributed objects in a
distributed system that underlies the Web service.


Larger chunks of data will be passed in a single call than
the objects in the underlying distributed system.


Web services are built on distributed objects; distributed
objects are built on nondistributed programming objects.
At each step, the granularity becomes finer.

Web Services and Distributed Objects


Application Areas


Web services are unlikely to perform adequately as high
-
performance system components because of the size
and parsing overhead of XML documents.


For example, it's hard to imagine a telephone exchange being
successfully implemented as a set of intercommunicating Web
services.


However, it's easy to imagine some types of
access

such as
allowing other carriers to request special phone numbers on their
network to such a system as Web services.


Web services are ideal in the case that one cannot
assume agreement on CORBA or EJB interfaces.


Use distributed objects to build high
-
performance
systems with a well
-
defined architecture, and Web
services to connect independent systems in a loosely
coupled fashion based on shared business processes
and documents.


. NET


Microsoft® .NET is a set of Microsoft software
technologies for connecting information, people,
systems, and devices. It enables a high level of software
integration through the use of XML Web services

small,
discrete, building
-
block applications that connect to each
other as well as to other, larger applications over the
Internet.


.NET is infused into the products that make up the
Microsoft platform, providing the ability to quickly and
reliably build, host, deploy, and utilize connected
solutions using XML Web services, all with the protection
of industry
-
standard security technologies.

Basic Elements of .NET





Smart Devices and.NET


Each smart device optimizes the way information is presented and
gathered

from converting text to speech to recognizing
handwriting.


Using XML, SOAP, and UDDI, smart devices are able to consume
XML Web services.


Smart devices are PCs, laptops, workstations, phones, handheld
computers, Tablet PCs, Microsoft® Xbox™ game consoles,… What
makes them "smart" is their ability to access XML Web services,
enabling you to interact with your data regardless of the location,
type, and number of devices you use.


Smart devices allow access to your information in an appropriate
form anytime and anywhere.


Smart devices "consume" (use) XML Web services and provide
Microsoft .NET experiences.


Microsoft Servers and .NET


With Microsoft® .NET, businesses will be able to turn key processes
into XML Web services. From the schedule for a doctor's office to
the catalog for a book seller to an exchange rate calculator for world
currencies.


Windows Servers facilitate the aggregation and accelerate the
integration of systems, applications, and partners using XML Web
services through the servers' deep level support of XML.


Simple access to mainframes with Microsoft Host Integration Server


Automatic conversions of existing data formats into XML with
Microsoft BizTalk Server.


Scalable servers that deeply integrate XML and are protected by
industry
-
standard technologies will provide the backbone for hosting
and deploying .NET software and services.


Microsoft Windows® 2000 Server, Microsoft Windows Server 2003, and
the Microsoft .NET Enterprise Servers fill this role.

Developer Tools and .NET



With Microsoft® Visual Studio® .NET and the Microsoft .NET Framework,
developers can develop XML Web services quickly and integrate them
easily with other applications.


Existing skills, can be deployed, because the .NET Framework allows you
to develop Web services using any modern program language.


Microsoft Visual Studio .NET and the Microsoft .NET Framework supply a
complete solution for developers to build, deploy, and run XML Web
services.


These tools help enhance the performance, reliability, and security of XML
Web services.


Microsoft Visual Studio .NET represents the best development environment
for .NET
-
connected software and services.


Visual Studio .NET advances the programming languages:


Microsoft Visual Basic®, with new object
-
oriented programming features;


Microsoft Visual C++®, which enables you to build .NET
-
connected applications;


C#, which brings RAD to the C and C++ developer.

MapPoint® .NET


Microsoft® MapPoint® .NET is a hosted,
programmable XML Web Service for integrating
maps, driving directions, distance calculations,
proximity searches and other location
intelligence into your applications, business
processes, and Web sites.