670 likes | 686 Views
Web Services Introduction. ITCS 4010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson, slides 3a version 0.1. Distributed Computing Concepts. Web services build upon earlier distributed computing concepts One of the underlying concepts is the client-server model. Client-server model. Server.
E N D
Web ServicesIntroduction ITCS 4010 Grid Computing, 2005, UNC-Charlotte, B. Wilkinson, slides 3a version 0.1.
Distributed Computing Concepts Web services build upon earlier distributed computing concepts One of the underlying concepts is the client-server model.
Client-server model Server Client Request service Database Server response
Remote Procedure Call Early distributed computing system introduced in the 1980’s. Allows a local program to execute a procedure on a remote computer and get back results from the procedure. Basis of certain remote operations such as mounting remote files in a shared file system.
Fundamental factors of RPC We need to know how and where to make the call. The basic RPC requires the calling program to know details about how to make the call (meaning and types augments and return value) The calling program also needs to know where to send the request.
Service registry RPC introduced the concept a service registry a third party used to identify location of “service” (procedure). Using a service registry is now part of what is now called a Service-Oriented Architecture.
Service-Oriented Architecture. Service registry Publish Find Bind Client Server (Service requester) (Service provider)
Later systems Later forms of remote procedure calls in 1990’s introduced distributed objects: Examples • CORBA (Common Request Broker Architecture) • Java RMI (Remote Method Invocation)
Some aspects for a new system • Universally agreed standardized interfaces • Inter-operability • The need to provide flexibility • Using the Internet as the network communication (Internet standards)
Web Services • Introduced in the 2000. • Software components designed to provide specific operations (“services”) accessible using standard Internet technologies and standardized protocols. The specific standards and protocols will be described shortly. • For machine interaction over a network.
Stateless Web Service • It is generally thought that web services should be stateless – they do not remember or store information themselves from one invocation to the next. • Any state information needed by the web service to complete a client request or maintained should be held separately.
First attempt as a stateful service A now defunct attempt at providing a stateful service was embodied in the OGSI standard which was part of the OGSA grid computing standard • Introduced in 2002(?) • Abandoned in 2004 Will look at this way briefly later.
Web Service with state Web services can be front-ends to stateful resources. Example Business application might access an inventory of items being held through a web service. Web service Database request data request data return data
Stateless web service + stateful resource Concept formalized in a standard called WS-RF framework. WS-RF also at the center of recent grid computing software (Globus 4.0). Provides a way of identifying resource through the web service, and other things such as resource lifetime
Web Service addressing Usually located by a URI. Example http://www.cs.uncc.edu:8080/axis/MyMath This URL is only supposed to be accessed by a computer program.
Internet Application Web service could be located on a computer anywhere on the Internet. Web Services User might interact with an application that accesses the web service to perform a function.
Note • The term “Web Service” is a little misleading as the web service need not be on the web. • It could be on the same computer as the client, or another computer in a local cluster.
WS-Addressing • WS-Resource Framework introduced a standard for addressing WS-Resources, called WS-Addressing • Introduces an End-Point Reference (EPR) to point to the service, which will provide the URL and possibly additional information about the service.
Service-Oriented Architecture • Client needs to: • Identify location of the required service • Know how to communicate with the service to get it to provide the actions required. • Uses service registry - a third party.
Service-Oriented Architecture Service registry 1. Publish 2. Find 3. Bind Service requester Service provider
Service-Oriented Architecture Steps: • Services “published” in a Service registry. • Service requestor asks Service Registry to locate service. • Service requestor “binds” with service provider to invoke service.
Key aspects Has similarities with RMI and other distributed object technologies (CORBA etc.) but: • Web Services are platform independent • They use XML within a SOAP message). • Most use HTTP to transmit message.
XML-based Web Services • XML provides a flexible basis for storing and retrieving service information on web services.
Structure of an XML document • Optional Prolog • Root Element
Prolog Includes: • Processing instruction to specify how to process document.. Uses symbol sequence: <? … ?> • Meta-information about document, and comments.
One PI identifies document as a XML document, e.g. <?xml version=“1.0” encoding=“UTF-8”?> • Comments, same form as HTML: <!-- this is a comment -->
Root element • Root element contains contents of document. • Other elements are within root element and can be nested.
XML Tags • Not predefined as in HTML. • Must define your own tags using names as names in a programming languages • As in programming languages, restrictions. Case sensitive. Start with a letter. • “Elements” have start and end tags. • Start tags can have attributes as in HTML.
Namespace Mechanism • If XML documents combined, can be problem if different documents use the same tag names to mean different things. • With namespace mechanism, tags given additional namespace identifier to qualify it.
Qualifying names Qualified name given by namespace identifier and name used in document: Qualified name = namespace identifier + local name
Namespace identifier • Uses URI’s (Uniform Resource Identifiers) - web naming mechanism. • URLs are a subset of URI, and would typically be used, e.g.: http://www.cs.wcu.edu/~abw/ns
Associating namespace identifier with local name • Names in document given a prefix, i.e.: <mypo:street> • Namespace identifier associated with prefix in root element:: xmlns:mypo=“http://www.cs.uncc.edu/~abw/ns”
Namespace Example prefix <mypo:po xmlns:mypo=“http://www.cs.uncc.edu/~abw/ns”> <mypo:description> Computer, Pentium IV, 4.7 Ghz, 4 Gbytes main memory </mypo:description> </mypo:po>
Can apply namespace to every tag without a prefix automatically if that is required: <mypo:po xmlns=“http://www.cs.uncc.edu/~abw/ns”> <description> Computer, Pentium IV, 4.7 Ghz, 4 Gbytes main memory </description> </mypo:po>
Defining Legal XML Tags Legal tags in a document defined optionally using either: Document type definitions (DTD) within document using <!DOCTYPE …. > (old, not allowed with SOAP) or XML schema
XML Schema • Flexible way of handing legal element names. Expressed in XML. • Schema is an XML document with required definitions. • Handles namespaces. • Has notation of data types
The name space given by the xmlns tag becomes the default namespace unless overridden by a prefix.
XML Schema StructureExample <?xml version=“1.0” encoding=“UTF-8”?> <myRootElement xmlns=http://www.cs.uncc.edu/namespaces/myName/ myMathService> … <operation> … </operation> … </myRootElement> Here all tags without prefixes have the namespace given
XML Schema StructureExample <?xml version=“1.0” encoding=“UTF-8”?> <myRootElement xmlns:math=http://www.cs.uncc.edu/namespaces/myName/ myMathService> … <math:operation> … </math:operation> … </myRootElement> Here the tag operation is qualified with the prefix math that identifies the namespace
Schema • One could arrange that all those processing the document are preconfigured to use a specific schema or, better • The scheme could be specified in the document
Associating a Schema with an instance of an XML document XML schema Document xlns:xsi=“http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=“ .. “
Schema validation • The schema approach allows documents that are supposed to conform to XML syntax and a specific schema to be checked against the scheme, prior to processing. Formally two aspects • Well-formedness – document conforms to rules of XML syntax. • Validity – checks the structure and identity of elements etc. that the document should have from that schema.
XML “scheme definition languages” (XSD) • Each XML document conforms to its own schema that defines the tags. • This gives an infinite number of XML “languages.” • Many XML languages invented for specific purpose. • All one needs is the language schema to use it.
Web Service Description • Need a way of formally describing a service, what is does, how it is accessed, etc. • An Interface Description language (IDL)
Web Service Definition Language (WSDL) A W3C standard XML document that describes three fundamental properties of a service: • What it is - operations (methods) it provides. • How it is accessed - data format, protocols. • Where it is located - protocol specific network address.
Parts of a web services WSDL document Root definitions and namespaces Abstract definition of service Binding definitions to network protocols Message definitions (parameters in method signature) Service definitions (where service is, ports) Type definitions - data types
Web Services 1 3 2 4 5 6 From http://www.globus.org
UDDI Registries Web service registries can be based upon UDDI registries (Universal Description Discovery, and Integration), introduced in 2001. UDDI specification standardized by OASIS (Organization for the Advancement of Structured Information Standards) See: http://www.oasis-open.org
Notes • The UDDI registry is a web service itself. • The (UDDI) registry itself has to be known to both the client and service. • Registry technically unnecessary if the client already knows about the service, but usually some form of service registration and locator is present.
UDDI Service registry UDDI Service definition Publish Find Location of service Give me your WSDL WSDL Service definition WSDL Request service operation Result Client Server (Service requester) (Service provider) Steps to access a web service in a Service-Oriented Architecture