Академический Документы
Профессиональный Документы
Культура Документы
Some software functional block Location, platform, code are irrelevant Loosely coupled software components that encapsulate discrete functionality and that are accessible over standard Internet protocols.The Stencil Group Web Services are a new breed of web application. They are self-contained, self-describing, modular applications that can be published, located, and invoked across the Web. IBM Web services are a form of distributed information system Gustavo Alonso
Web services: concepts, architectures and applications
Outline
Client-Server to 3-Tier Middleware Technology Web services
Outline
Client-Server to 3-Tier Middleware Technology Web Services
Presentation Layer Application Logic Layer Res. Management Layer Information System
Resource Management Layer Data sources from databases or other information systems, specialized computing services,
Client
2-tier
UI
3-tier
Client
UI
Client
Presentation Layer
Presentation Layer
Presentation Layer
Server
Application Logic Layer
Res. Management Layer Application Logic Layer Res. Management Layer
Middleware
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 7
Application Framework
User Interface Userware Presentation Interface Task Management
A P P L I C A T I O N
Middleware
Control Integration
Data Repository Enterpriseware System Service Hardware Computer and Communication Facility
8
combined catalog
UI Presentation Layer 1
Rice B
Drink C Drink C Food D Food D Food E
All logics are embedded in your web programs (e.g., *.asp, *.php, )
(data-oriented)
Client
Presentation Layer
e.g., The rule can be: If a source is not html or xml responding, show service not available e.g., ODBC/Vendor_Specific_Protocol and send a notification Res. Management Layer e-mail to Manager A Eg., database and . management system
(Oracle, DB2)
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 10
UI Presentation Layer 1
Presentation Layer
Products that support Java Message Service: Apache ActiveMQ, Oracle AQ, IBM MQ, etc.
Outline
Client-Server to 3-Tier Middleware Technology Web Services
13
14
Globalization of Processes
EAI B2B E-Services
Workflows
Enterprise
Distributed Workflows
Inter-Enterprise
Web Processes
Global
16
Processes driving the Networked Economy COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services)
Outline
Client-Server to 3-Tier Middleware Technology 101 Web Services
17
18
19
20
21
23
24
Service requestor
Consumes the web services
Service registry
Logically centralized registry provides a central place where allows developers to publish new services or search (or discover) existing ones
25
Register
Service Requester
Service Provider
26
27
28
29
Binding to SOAP
30
Binding Element
The binding element has two attributes name, type Name: defines the name of the binding (you can use any name you want). Type: points to the port for the binding, in this case the "glossaryTerms" port.
31
SOAP: Binding
The soap:binding element has two attributes - style, transport Style: could be "rpc" or "document". Transport defines the SOAP protocol to use. In this case we use HTTP.
32
Operation
The operation element defines each operation that the port exposes. --For each operation the corresponding SOAP action has to be defined. You must also specify how the input and output are encoded. In this case we use "literal".
33
HelloServices.wsdl (1)
<?xml version="1.0" encoding="UTF-8"?> <definitions name="HelloService" targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
Definition
<message name="SayHelloRequest">
<part name="firstName" type="xsd:string"/> </message> <message name="SayHelloResponse"> <part name="greeting" type="xsd:string"/> </message>
Message
34
previous slides
HelloServices.wsdl (2)
<input message="tns:SayHelloRequest"/> <output message="tns:SayHelloResponse"/>
</operation> </portType>
PortType
matched operations
<binding name="Hello_Binding" type="tns:Hello_PortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="sayHello"> <soap:operation soapAction="sayHello"/>
<input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:helloservice" use="encoded"/> </input> <output> <soap:body namespace="urn:examples:helloservice" use="encoded"/> </output> </operation> COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) </binding> 35
Binding
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
HelloServices.wsdl (3)
previous slides <service name="Hello_Service"> <documentation>WSDL File for HelloService</documentation>
Service
36
What is SOAP?
SOAP stands for Simple Object Access Protocol SOAP is XML-based SOAP is a protocol for accessing a Web Service SOAP is for communication between applications SOAP is a format for sending messages SOAP is via Internet (HTTP) SOAP is platform independent SOAP is language independent SOAP will be developed as a W3C standard
37
38
Syntax Rules
A SOAP message MUST be encoded using XML A SOAP message MUST use the SOAP Envelope namespace A SOAP message MUST use the SOAP Encoding namespace A SOAP message must NOT contain a DTD reference A SOAP message must NOT contain XML Processing Instructions
39
SOAP Message
40
41
Envelope Element
The xmlns:soap namespace The encodingStyle attribute --soap:encodingStyle="URI" --<soap:Envelope xmlns:soap="http://www.w3.org/2001/12 /soap-envelope" soap:encodingStyle="http://www.w3.org /2001/12/soap-encoding">
42
Header Element
Actor ---A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. The SOAP actor attribute is to address the Header element to a particular endpoint mustUnderstand=0/1 ---It is to indicate whether a header entry is mandatory or optional for the recipient to process. encodingStyle
43
Header Element
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soapencoding"> <soap:Header> <m:Trans xmlns:m="http://www.w3schools.com/transaction/" soap:mustUnderstand="1">234 soap:actor="http://www.w3schools.com/appml/ </m:Trans> </soap:Header> ... ... </soap:Envelope>
44
Body Element
45
Fault Element
Fault element has the following sub elements:
Value of faultcode
Error VersionMismatch MustUnderstand Client Server Description Found an invalid namespace for the SOAP Envelope element An immediate child element of the Header element, with the mustUnderstand attribute set to "1", was not understood The message was incorrectly formed or contained incorrect information There was a problem with the server so the message could not proceed
46
SOAP Hand-shaking
Example: weather services (refer to the link provided on course home page)
47
Envelope Body
48
Envelope
Body
49
SOAP Response
Delivered by HTTP with corresponding status code
50
SOAP Request
51
SOAP Response
52
53
Yellow
Classification of business and services Uses widely known classification schemes such as NAICS, UN/SPSC (ECMA), SIC, and geographic taxonomies
Green
Technical info for consuming the service Called a Type Model (tModel) Defines the services API, binding requirements, and so on Usually a pointer to a WSDL document
http://www.uddi.org/schema/uddi_v2.xsd
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 54
3-tier
Client
UI
Client
Presentation Layer
Presentation Layer
Server
Application Logic Layer Res. Management Layer
55
* Can you see a collaboration activity? * Can you define several web services to support that? Study which web services should be made known to client and which should be made known to service provider.
56
57
References
http://www.w3schools.com/ Darren Barefoot, Web Services Primer, Sept 2002, http://www.capescience.com/education/primer/index.sht ml New to Web Services, http://www106.ibm.com/developerworks/webservices/newto E Cerami, Web Services Essentials, OReilly, Feb 2002 David S. Linthisum, B2B Application Integration, Addison Wesley, 2001
58
..\code1.JPG
59
60
61