Slide 1
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Web Services
Slide 2
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
‧Web services facilitate the collaboration of e-businesses–e-business applications communicate with each other (App-to-App
Communication)• Web services is
– Platform independent– Language independent– Location independent
Slide 3
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Web Services are Different…• UNIX RPC – Requires binary-compatible UNIX
implementation at both ends• CORBA – Requires compatible ORBs• RMI – Requires Java at each endpoint• DCOM – requires Windows at each endpoint
Web Services are Language-independent, Component Model-independent, Location-independent, Firewall friendly
Web services enable App-to-App communication
Slide 4
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
• Web Services Characteristics– Self-describing– Easy to integrate the services provided– Interoperability– Ubiquity– Low Barrier to Entry
Slide 5
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
What is Web Services?
• Web services is different from application service providers (ASPs)– Application Service Providers (ASPs) are third-party entities that manage
and distribute software-based services and solutions to customers across a wide area network from a central data center.
– ASPs allow companies to outsource some or almost all aspects of their information technology needs.
• The ASP model is based on application rental (as opposed to purchase)• Key: Web Services could be a way ASPs deliver their
services/applications.ASP Web ServicesBusiness Model Technical Architecture
Mainly Complete Applications
Mainly Modular & Data Oriented
Slide 6
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
What is Web Services?
• W3C Definition: Web service is a software system identified by a URI, whose public interfaces and bindings are defined and described using XML. Itsdefinition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols
Slide 7
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
What is Web Services?
“Web Services is a standards-based software technology that lets programmers and integrators combine existing and new systems or applications in new ways over the Internet, within a company’s boundaries, or across many companies. Web Services allow interoperability between software written in different vendors, or running on different operating systems or platforms”(IDC, Web Services: Analyst: Sophie Janne Mayo, March 2002)
Slide 8
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Web Services• Web services is both a process and set of protocols for
finding and connecting to software exposed as services over the Web
• Web services = repository + client + provider• Three major aspects:
– Service provider– Service requester– Broker
Slide 9
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Collaboration Environment
• Web services builds on SOAP’s capability for distributed, decentralized network communication by adding new protocols and conventions that expose business functions to interested parties over the Internet from any Web-connected device. – SOAP is not a stand-alone technology, but the result of synergies between
XML and HTTP.• Web services satisfies the need for a flexible and efficient business
collaboration environment.– It links loosely couple systems using technology that doesn’t bind them to
a particular programming language, component model, or platform.
Slide 10
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
What does Web Services includes?
• Web services (WS) includes– Describing: WS describes its functionality and attributes so that other
applications can figure out how to use it.– Exposing: WS registers with a repository that contains a white page
holding basic service-provider information, a yellow pages listing services by category, and a green pages describing how to connect and use the services.
– Being invoked: When a WS has been located, a remote application can invoke the service.
– Returning a response: When a WS has been invoked, results are returned to the requesting application.
Slide 11
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Basic Conceptual Architecture
Component View
Web Services consist of a set of messaging protocols, programming standards, and network registration and discovery facilities that expose business functions to authorized parties over the Internet from any web-connected device.
Slide 12
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Service View
Subscriber Publisher
Three major aspects:•Service provider : provides an interface for software that can carry out a specified set of tasks•Service requester : discovers and invokes a software service to provide a business solution.
•The requester invokes a remote procedure call on the service provider, passing parameter data to the provider and receiving a result in reply.
•Repository or broker : manages and publishes the service
Broker
Slide 13
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Components of Web Services • Service
– software module deployed on network accessible platforms provided by the service provider
– It exists to be invoked by or to interact with a service requestor– It may also function as a requestor, using other web services in its
implementation• Service Description
– contains the details of the interface and implementation of the service – includes its data types, operations, binding information, and network location – include categorization and other meta data to facilitate discovery and utilization
by requestors – realized as a set of XML description documents
Slide 14
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Roles in Web Services• Service Provider
– From a business perspective, this is the owner of the service – From an architectural perspective, this is the platform that hosts access to the service – also referred to as a service execution environment or a service container – role in the client-server message exchange patterns is that of a server
• Service Requestor– From a business perspective, this is the business that requires certain function to be
satisfied – From an architectural perspective, this is the application that is looking for and invoking
or initiating an interaction with a service – played by a browser driven by a person or a program without a user interface – role in the client-server message exchange patters is that of a client
Slide 15
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Roles in Web Services• Discovery Agency
– a searchable set of service descriptions where service providers publish their service descriptions
– can be centralized or distributed – support both the pattern where it has descriptions sent to it and where the
agency actively inspects public providers for descriptions – Service requestors may find services and obtain binding information (in the
service descriptions) during development for static binding, or during execution for dynamic binding
• For statically bound service requestors, the service discovery agent is in fact an optional role in the architecture, as a service provider can send the description directly to service requestors.
• service requestors can obtain a service description from other sources besides a service registry, such as a local filesystem, FTP site, URL, or WSIL document.
Slide 16
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Operations in Web Services• Publish
– a service needs to publish its description such that the requestor can subsequently find it
• Find– the service requestor retrieves a service description directly or queries the
registry for the type of service required – find operation may be involved in two different lifecycle phases for the service
requestor • at design time in order to retrieve the service's interface description for program
development • at runtime in order to retrieve the service's binding and location description for
invocation
Slide 17
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Operations in Web Services
• Interact– the service requestor invokes or initiates an interaction with the
service at runtime using the binding details in the service description to locate, contact, and invoke the service
– Examples of interaction• single message one way, broadcast from requester to many services, a
multi message conversation, or a business process – Synchronous or asynchronous
Slide 18
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
What to do?
• When a company want to take advantage of WS technology, what does it need to do?
1. Decide on the service it wants to provide.2. Pick a registry for uploading its information.3. Decide how to list its services at the registry.4. Define explicitly how users can connect to its service.
Slide 19
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
WS Architecture
• Three major aspects:– Service provider : provides an interface for software that can carry
out a specified set of tasks– Service requester : discovers and invokes a software service to
provide a business solution. • The requester invokes a remote procedure call on the service provider,
passing parameter data to the provider and receiving a result in reply.– Repository or broker : manages and publishes the service
Slide 20
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Key Technologies
• UDDI– A protocol for describing WS components that allows business to register
with an Internet directory• WSDL
– Built around an XML-based service Interface Definition Language that defines both the service interface and the implementation details
• WSDL details may be obtained from UDDI entries that describe SOAP messages needed to use a particular WS.
• SOAP– A protocol for communication with a UDDI service
Slide 21
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Slide 22
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
SOAP
• Simple Object Access Protocol (SOAP) is a XML-based protocol that offers platform, language, and transport independence for data exchange between partners and suppliers.
• SOAP provides a decentralized, distributed environment.• SOAP defines an XML envelop for delivering XML
content and specifying a set of rules for servers to follow when they receive a SOAP message.
Slide 23
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Slide 24
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
SOAP Protocol
• SOAP is a text-based protocol that uses XML– IIOP for CORBA are binary protocols– SOAP is easier to move across firewalls than IIOP because it is
text-based.– SOAP is standard-driven rather than vendor-driven because it is
based on XML.
Slide 25
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
SOAP Message Structure• SOAP Envelope : root of the XML document that defines a SOAP message.• SOAP Header : (optional) provides a modular way of directing SOAP servers to do
processing before passing the SOAP message on. E.g. instructs a server to add transaction or authentication information.
• SOAP Body : where the transported XML is loaded.
Slide 26
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Example
• ZwiftBooks opens the server up to collectors who wish to notify ZwiftBooks about books they have for sale.
1. Define a top-level element and related subelements that will trigger processing of the book availability data by the SOAP server.
2. Define a schema (DTD or XML Schema) that dictates the form of the XML that will arrive from collectors.
3. Specify a namespaces that is unique to ZwiftBooks. (e.g. the ZwiftBooks Web site or URI)
4. Configure the server to return a fault if the incoming SOAP message is not one of the special elements defined in Step 1.
Slide 27
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Slide 28
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Slide 29
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
• Message paths– Messages may be routed from server to server along a so-called
message path.
• SOAP Intermediaries– Intermediaries act in different roles, including proxies, caches,
store-and-forward hops, and gateway.
Slide 30
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
UDDI– Universal Description, Discovery and Integration
• Standards based specification for service description and discovery
• Programmatic descriptions of business and services they support
• Publishing APIs• Inquiry APIs
Slide 31
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
UDDI Registry3 categories
White Pages Yellow Pages Green Pages
-Directory of names-Provider info-Contact info
-Directory of Domains-Specific Search using Context such as location, service type
-point to White pages
-Directory of Biz info-Info about Biz Model-Technical details of provided service
-Info Business Process
Slide 32
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
UDDI
• UDDI stems from a cooperative agreement among Microsoft, IBM, and Ariba on an XML-based specification for establish a registry of business and services on the Internet. (began in August 2000)
• UDDI defines a layer above SOAP in an interoperability stack that builds on TCP/IP, HTTP, and XML.
Slide 33
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Scenario of interaction for connection to a company server usingUDDI discovery
1. A company is interested in writing a software to connects to several book-service providers and comparing price and delivery times for each.
2. It needs a program that can connect to the UDDI business registry via either a Web interface or a tool that use the Inquiry API.
3. After a lookup based on an appropriate yellow pages listing, thecompany obtains a businessEntity that represents a book-service provider, ZwiftBooks.
4. Using the businessEntity, the client can either drill down for more detail or request a complete businessEntity structure. The objective is to obtain a bindingTemplate that provides the information about how to connect to ZwiftBooks WS.
5. Based on the details of bindingTemplate, the company sets up its program to interact with the ZwiftBooks WS.
6. At runtime, the program invokes the WS based on the connection details provided in the bindingTemplate.
Slide 34
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
WSDL – Web Services Definition Language• A description language to define web
service interfaces and how to invoke them. (how to connect to Web service providers)
• Allows both the message and the operations on the messages to be defined abstractly in XML
• An XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-orientated information - WSDL specification
• Where does WSDL appear?– Reside in UDDI or directory
services– Provided via configuration or other
means such as in the body of SOAP request replies
Slide 35
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
WSDL schema
• A WSDL schema includes:– Service, Types Message,
Operation, Port Type, Binding, Port
Slide 36
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Value of Web Services
Simple•HTML-like simplicity for App-to-App Communication•Platform Independent•Development language Independent
Standards-based ( Interoperability)•Broad agreement on core standards: SOAP, WSDL, UDDI•Broad supported by major platform providers (IBM, Microsoft, Oracle, etc)
Business Driven•New application/revenue models•Strengthen relationships with customers•Optimize business process / Reduce costs
Slide 37
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Web Service scenario
WorkflowEngine ERP Adapter
2.Locate Suppliers
3 RequestQuotes
4 Sort Responses
5 Obtain Approval
6 Generate andSend Order
7 Delivery,Update inventory
SOAPAdapter
1. low inventoryStart workflow
PrivateUDDI
PublicUDDI
HTTP
2.Locate Suppliers
WSDL
WSDL
fi rew
all
3 RequestQuotes
3 RequestQuotes
6 Generate andSend Order
7 Delivery,Update inventory
By using Web Services and related repositories, company is able to streamlineand automate its request for quote (RFQ) and order fulfillment process.
Factory
Slide 38
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Business Benefit• Expand markets
– Web service can be decentralized and distributed over internet and access by wide variety of communication device
– Attract new business by extending application to much more audience
• Smooth B2B integration– Create once, expose to many customers– Provide affordable, easy-to-implement, end-to-end application integration solution
• Discovery of business partner that meet the business need– E.g search for cheapest web services by system
• New business – New subscription or pay-to-use model– Web services can combined to build a new web services– Assembly of new applications by linking existing internal and external third-party Web Services (Web
Services Aggregators)
Slide 39
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Pricing Service
Order EntryService
InventoryAvailable Service
Tax CalculatorService
Negotiated PricingService
CurrencyConversion
ServiceBusiness Benefit
• Enhance business automation by combine web services at run time• Increase visibility by enabling real-time connections among
operational systems– Significantly increase managers’ visibility into a data-centric business processes
• Increase productivity– Web Services are self-describing business function– Allow system to trigger the business process automatically
Slide 40
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Technical Benefit
• Improve efficiency of application development by assembly
• Save development effort by re-use of web services• Support both applications and people with the same Web
Service• Lower maintenance cost and easy management
Slide 41
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Technical Benefit
• Neutral platform – Highly compatibility between various operating systems
– Universally Agreed Specifications
• Strong industry support– All major vendors support– Available solution for most platform
• Flexible in development
Slide 42
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Technical Benefit• Extend legacy application functionality
– Ease of legacy system integration– Develop SOAP/XML Wrapper– Look like a regular services from customer view
SERVICE
Legacy System
SOAP/XML Wrapper
Components
SOAP/XML Wrapper
UDDI Registry
Application
WSDLServices“Yellow Page”Tool
XML/ SOAP (static lookup)
XML/SOAP(dynamic lookup)
XML over SOAP /ebXML
Slide 43
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Barriers on Applying Web Services
• Lacking of Standard– Security :
• OASIS (Organization for the Advancement of Structured Information Standards) proposes SAML
• WS-Interoperability proposes WS-Security
– Routing SOAP messages :• Microsoft releases WS-routing• IBM has no plan to support and will push another protocol
– Workflow : • Microsoft - XLANG• IBM - WSFL (Web Services Flow Language)• Team to develop BPEL (Business Process Execution language)
Slide 44
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Barriers on Applying Web Services• Performance
– XML has lengthy data format– Estimates the size of a typical XML document at 10 times of an equivalent EDI transmission.
• Difficult to build trust between a Consumer & Web Service Developer
• Dependency– If server from an external party goes down, your application will be affected
• Company Scale – Small business cannot afford the cost in developing web services
Slide 45
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Barriers on Applying Web Services
• Critical mass of deployments– Without enough web services, company still need to create
applications themselves
Slide 46
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Keep Their Legacy System
• Overview:– One of the most popular department stores in the United States – They want to improve communication between Nordstrom's e-commerce
site and its other application– Since the Nordstrom.com uses Microsoft software– but the company’s enterprise resource planning (ERP) applications
which it employs to check inventory, place orders and organize company resources run on Hewlett-Packard UNIX servers, and the inventory data resides on IBM mainframes
– At first, the company considered connecting these systems using traditional middle-ware product. But finally, the management decided that the available solutions were too expensive and time-consuming.
Slide 47
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Keep Their Legacy System (cont.)
– Nordstom is using Web services to connect its e-commerce site to its gift-card-management and cosmetics-replenishment applications, which reside on legacy systems. Customers can redeem Nordstrom gift cards through the Web Services that link nordstrom.com to the gift-card management systems
Legacy system
Gift-card management Cosmetics-replenishment
Nordstom.com
Gift CardWeb Service
Slide 48
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Keep Their Legacy System (cont.)
– Another Web services implementation is designed to improve Nordstrom's cosmetics-inventory system. When a customer purchases a cosmetics product from nordstrom.com, a Web service automatically updates the cosmetics replenishment application to reflect the changed inventory.
Legacy system
Cosmetics inventory
Nordstom.com
Purchase order
InventoryWeb Service
Slide 49
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
What does it contribute?
• Meet the management need, since they don't want to reinvent the wheel
• Enable cost cutting, and better customer service, since customer don't need to wait a queue for redeem their gift cards and no longer need too many staff for inventory control.
• As nordstom.com concern about the security problem of Web service, so they just deploy Web services on the company's private network.
Slide 50
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Other Examples:
• Search information e.g using Google API• Validation e.g. credit card number, e-mail address and
check spelling …..• Get specified information e.g networking related
information, weather, news or stock price …..• Translation: translate from one language to another
language
Slide 51
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Search by Google API in my site
Slide 52
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Validate the e-mail address
Slide 53
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Validate my Spelling
Slide 54
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Query IP information
Slide 55
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Translation
Slide 56
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
Goolge WSDL
<definitions name="GoogleSearch" targetNamespace="urn:GoogleSearch" xmlns:typens="urn:GoogleSearch" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
Web Service URI
All Namespaces
Slide 57
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
<types><xsd:schema
xmlns=http://www.w3.org/2001/XMLSchematargetNamespace="urn:GoogleSearch">
<xsd:complexType name="GoogleSearchResult"><xsd:complexType name="ResultElement"><xsd:complexType name="ResultElementArray"><xsd:complexType
name="DirectoryCategoryArray"><xsd:complexType name="DirectoryCategory">
</xsd:schema></types>
XML Schema
DataType
Slide 58
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
<message name="doGoogleSearch"><part name="key" type="xsd:string" /><part name="q" type="xsd:string" /><part name="start" type="xsd:int" /><part name="maxResults" type="xsd:int" /><part name="filter" type="xsd:boolean" /><part name="restrict" type="xsd:string" /><part name="safeSearch" type="xsd:boolean" /><part name="lr" type="xsd:string" /><part name="ie" type="xsd:string" /><part name="oe" type="xsd:string" />
</message><message name="doGoogleSearchResponse"><part name="return" type="typens:GoogleSearchResult" />
</message>
Data Unit
Request Parameter
Return Parameter
Slide 59
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
<portType name="GoogleSearchPort"><operation name="doGetCachedPage"><operation name="doSpellingSuggestion"><operation name="doGoogleSearch">
<input message="typens:doGoogleSearch" /><output message="typens:doGoogleSearchResponse" />
</operation></portType>
Methods opened for remote calling
Slide 60
ECT 7010 Fundam
entals of E-Com
merce Technologies Edited by Christopher C. Yang
<binding name="GoogleSearchBinding" type="typens:GoogleSearchPort"><soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /><operation name="doGetCachedPage"><operation name="doSpellingSuggestion"><operation name="doGoogleSearch">
</binding><service name="GoogleSearchService">
<port name="GoogleSearchPort" binding="typens:GoogleSearchBinding"><soap:address location="http://api.google.com/search/beta2" />
</port></service>
Communication style
Web service endpoint