Cloud Computing: 20
Cloud Service Modeling
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharshi Dayanand Saraswati University Ajmer
Basic Concept of WEB Services
6
• A Web service typically carries comprehensive business
logic, can be searched through the Web, and has to be
accessed through the Internet or Intranet environment.
Above all, a Web service is published in a standard language
and accessed through a standard protocol.
Basic Concept of WEB Services
• A Web service is a programmable module with standard
interface descriptions that provide universal accessibility
through standard communication protocols. The functions
offered by Web services can be implemented in different
programming languages on different platforms.
7
Basic Concept of WEB Services
 The paradigm of Web Services is changing the Internet
from a repository of Web Content into a repository of
Services in Three Significant Ways:
1. First, by means of each organization exposing its business
applications as services on the Internet and making them
accessible via standard programmatic interfaces, this model
of Web services offers a promising way to facilitate
Business-to-Business B2B) collaboration within and across
enterprise boundaries
8
Basic Concept of Web Services
2. Second, the Web services technology provides a uniform
and loosely coupled integration framework to increase
cross-language and cross-platform interoperability for
distributed computing and resource sharing over the
Internet, inside or outside of firewall.
3. Third, the paradigm of Web services opens a new cost-
effective way of engineering software to quickly develop
and deploy Web applications, by dynamically integrating
other independently published Web service components
into new business processes.
9
Modeling a Web Service
 The Web Services Description Language (WSDL) has
become an ad hoc industry standard for describing a Web
service
 Simple Object Access Protocol (SOAP) has become an ad
hoc industry standard for accessing a Web service.
 WSDL Version 2 and SOAP Version 1.2 are endorsed by the
World Wide Web Consortium (W3C).
10
Basic Concept of WSDL Modeling
 WSDL is “an XML format for describing network services as a
set of endpoints operating on messages containing either
document-oriented or procedure-oriented information”
(http://www.wsdl.org).
 It is created to define the public interface of a Web service,
including its functionalities and how to invoke them.
11
Basic Concept of WSDL Modeling
 A WSDL document defines the protocol bindings and
message formats required to interact with the Web services
listed in its directory.
 The supported operations and messages are described
abstractly, associated with a concrete network protocol and
message format.
12
WSDL and SOAP (Interface and
Protocol)
 WSDL provides a notation to answer the following three
questions:
 What is the service about?
 Where does it reside?
 How can it be invoked? (i.e., what, where, and how)
13
WSDL and SOAP (Interface and
Protocol)
 WSDL is often used in combination with SOAP and XML
schema to define a Web service over the Internet.
 A client program reads a WSDL document to understand
what it can do; data types used are embedded in the
WSDL file in the form of XML schema.
 The client then uses SOAP to actually invoke the
functions listed in the WSDL document.
14
Basic Elements of WSDL
 A Web service is defined as a set of
ports, each publishing a collection of
port types that bind to network
addresses using a common binding
mechanism.
 Every port type is a published
operation that is accessible through
messages.
 Messages are in turn categorized into
input messages containing incoming
data arguments and output messages
containing results.
 Each message consists of data
elements; every data element must
belong to a data type, either an XML
Schema Definition (XSD) simple type
or a XSD complex type.
15
Sample Segment of a WSDL Document
 The tag portType defines “productPrice” as
the name of a port, and “getPrice” as the
name of an operation.
 The “getPrice” operation defines an input
message named “getPriceRequest” and an
output message “getPriceResponse.”
 The tag message defines the parameters
and associated data types of the input
message and the output message.
 Compared to traditional programming
language, “productPrice” maps to a
function library, “getPrice” maps to a
function with “getPriceRequest” as the
input parameters and “getPriceResponse”
as the return parameters.
<message name="getPriceRequest">
<part name="productid"
type="xs:string"/></message>
<message name="getPriceResponse">
<part name="value"
type="xs:string"/></message>
<portType name="productPrice">
<operation name="getPrice">
<input
message="getPriceRequest"/>
<output
message="getPriceResponse"/>
</operation>
</portType>
16
Operation Types Defined in WSDL
 WSDL defines four types of operations: one-way, request-
response, solicit response, and notification.
 The one-way operation receives a message but does not
return a response message.
 The request-response operation receives a request and
returns a response.
 The solicit-response operation sends a request for a
response.
 The notification operation sends a message but does not
wait for a response.
 The request-response type is the most frequently used
operation type.
17
Web Services Communication
Protocol: SOAP
 SOAP is a simple and lightweight protocol for exchanging
structured and typed information among Web services.
 In the core of the Web services model, SOAP acts as the
messaging protocol for transport with binding to existing
Internet protocols, such as Hypertext Transfer Protocol
(HTTP) and Simple Mail Transfer Protocol (SMTP) as
underlying communication protocols.
 Defining a uniform way of passing XML-encoded data, SOAP
also enables a way of conducting Remote Procedure Calls
(RPCs) binding with HTTP.
18
Web Services Communication
Protocol: SOAP (Cont’d)
 In short, SOAP provides a way to communicate between
applications running on different operating systems, with
different technologies, and programming languages.
 SOAP is endorsed by W3C and key industry vendors such as
Sun Microsystems, IBM, Microsoft, etc.
 Detailed information about SOAP can be found at the W3C
Web site at http://www.w3c.org/TR/SOAP.
19
SOAP Envelope (Header and Body)
POST /InServicesComputing HTTP/1.1
Host: www.servicescomputing.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 100
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-
envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-
encoding">
<soap:Header>
<m:Payment
xmlns:m="http://www.servicescomputing.org/paymen
t/"
soap:actor="http://www.servicescomputing.org/appm
l/">
soap:mustUnderstand="1">
123
</m:Payment>
</soap:Header>
<soap:Body>
<!-- Request message -->
<m:GetPrice
xmlns:m="http://www.servicescomputing.org/pr
ices">
<m:Item>Proceedings</m:Item>
</m:GetPrice>
<!-- Response message -->
<m:GetPriceResponse
xmlns:m="http://www.servicescomputing.org/pr
ices">
<m:Price>70</m:Price>
</m:GetPriceResponse>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
20
Binding of WSDL to SOAP
 A WSDL document defines how to access a service
operation using the element binding: the message format
and protocol details for each port.
 The binding tag has two attributes: the name attribute and
the type attribute.
 The name attribute defines the name of the binding, and
the type attribute points to the port for the binding, in
this case it is the “productPrice” port.
21
Binding of WSDL to SOAP
 The tag soap:binding has two attributes: the style
attribute and the transport attribute. The style attribute
can be either “ RPC (Remote Procedure Call)” or
“document.”
 The transport attribute defines the SOAP protocol to use,
in this example it is “HTTP.” The tag operation defines
each operation that the port exposes. For each
operation, the corresponding SOAP action needs to be
defined. One needs to specify how the input and output
messages are encoded.
22
An example WSDL binding segment
<message name="getPriceRequest">
<part name="productid" type="xs:string"/>
</message>
<message name="getPriceResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="productPrice">
<operation name="getPrice">
<input message="getPriceRequest"/>
<output message="getPriceResponse"/>
</operation>
</portType>
<binding type="productPrice"
name="b1">
<soap:binding style="document" trans-
port="http://schemas.xmlsoap.org/soa
p/http"/>
<operation>
<soap:operation
soapAction="http://servicescomputing
.org/getPrice"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
23
Publishing a Web Service in Registry
 Universal Description, Discovery, and Integration (UDDI) is
an ad hoc industry standard that provides a “meta service”
for publishing and locating Web services by enabling robust
queries against rich metadata.
 The UDDI working group includes leading technology
vendors, such as IBM, HP, and Microsoft. Detailed
information about UDDI can be found at its official Web site
at http://www.uddi.org/.
24
Assignment
• What is the role of WSDL in Web Service
Modeling
• Explain the usage of SOAP in web service
modleing

Cloud computing 20 service modelling

  • 1.
    Cloud Computing: 20 CloudService Modeling Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
  • 2.
    Basic Concept ofWEB Services 6 • A Web service typically carries comprehensive business logic, can be searched through the Web, and has to be accessed through the Internet or Intranet environment. Above all, a Web service is published in a standard language and accessed through a standard protocol.
  • 3.
    Basic Concept ofWEB Services • A Web service is a programmable module with standard interface descriptions that provide universal accessibility through standard communication protocols. The functions offered by Web services can be implemented in different programming languages on different platforms. 7
  • 4.
    Basic Concept ofWEB Services  The paradigm of Web Services is changing the Internet from a repository of Web Content into a repository of Services in Three Significant Ways: 1. First, by means of each organization exposing its business applications as services on the Internet and making them accessible via standard programmatic interfaces, this model of Web services offers a promising way to facilitate Business-to-Business B2B) collaboration within and across enterprise boundaries 8
  • 5.
    Basic Concept ofWeb Services 2. Second, the Web services technology provides a uniform and loosely coupled integration framework to increase cross-language and cross-platform interoperability for distributed computing and resource sharing over the Internet, inside or outside of firewall. 3. Third, the paradigm of Web services opens a new cost- effective way of engineering software to quickly develop and deploy Web applications, by dynamically integrating other independently published Web service components into new business processes. 9
  • 6.
    Modeling a WebService  The Web Services Description Language (WSDL) has become an ad hoc industry standard for describing a Web service  Simple Object Access Protocol (SOAP) has become an ad hoc industry standard for accessing a Web service.  WSDL Version 2 and SOAP Version 1.2 are endorsed by the World Wide Web Consortium (W3C). 10
  • 7.
    Basic Concept ofWSDL Modeling  WSDL is “an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information” (http://www.wsdl.org).  It is created to define the public interface of a Web service, including its functionalities and how to invoke them. 11
  • 8.
    Basic Concept ofWSDL Modeling  A WSDL document defines the protocol bindings and message formats required to interact with the Web services listed in its directory.  The supported operations and messages are described abstractly, associated with a concrete network protocol and message format. 12
  • 9.
    WSDL and SOAP(Interface and Protocol)  WSDL provides a notation to answer the following three questions:  What is the service about?  Where does it reside?  How can it be invoked? (i.e., what, where, and how) 13
  • 10.
    WSDL and SOAP(Interface and Protocol)  WSDL is often used in combination with SOAP and XML schema to define a Web service over the Internet.  A client program reads a WSDL document to understand what it can do; data types used are embedded in the WSDL file in the form of XML schema.  The client then uses SOAP to actually invoke the functions listed in the WSDL document. 14
  • 11.
    Basic Elements ofWSDL  A Web service is defined as a set of ports, each publishing a collection of port types that bind to network addresses using a common binding mechanism.  Every port type is a published operation that is accessible through messages.  Messages are in turn categorized into input messages containing incoming data arguments and output messages containing results.  Each message consists of data elements; every data element must belong to a data type, either an XML Schema Definition (XSD) simple type or a XSD complex type. 15
  • 12.
    Sample Segment ofa WSDL Document  The tag portType defines “productPrice” as the name of a port, and “getPrice” as the name of an operation.  The “getPrice” operation defines an input message named “getPriceRequest” and an output message “getPriceResponse.”  The tag message defines the parameters and associated data types of the input message and the output message.  Compared to traditional programming language, “productPrice” maps to a function library, “getPrice” maps to a function with “getPriceRequest” as the input parameters and “getPriceResponse” as the return parameters. <message name="getPriceRequest"> <part name="productid" type="xs:string"/></message> <message name="getPriceResponse"> <part name="value" type="xs:string"/></message> <portType name="productPrice"> <operation name="getPrice"> <input message="getPriceRequest"/> <output message="getPriceResponse"/> </operation> </portType> 16
  • 13.
    Operation Types Definedin WSDL  WSDL defines four types of operations: one-way, request- response, solicit response, and notification.  The one-way operation receives a message but does not return a response message.  The request-response operation receives a request and returns a response.  The solicit-response operation sends a request for a response.  The notification operation sends a message but does not wait for a response.  The request-response type is the most frequently used operation type. 17
  • 14.
    Web Services Communication Protocol:SOAP  SOAP is a simple and lightweight protocol for exchanging structured and typed information among Web services.  In the core of the Web services model, SOAP acts as the messaging protocol for transport with binding to existing Internet protocols, such as Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP) as underlying communication protocols.  Defining a uniform way of passing XML-encoded data, SOAP also enables a way of conducting Remote Procedure Calls (RPCs) binding with HTTP. 18
  • 15.
    Web Services Communication Protocol:SOAP (Cont’d)  In short, SOAP provides a way to communicate between applications running on different operating systems, with different technologies, and programming languages.  SOAP is endorsed by W3C and key industry vendors such as Sun Microsystems, IBM, Microsoft, etc.  Detailed information about SOAP can be found at the W3C Web site at http://www.w3c.org/TR/SOAP. 19
  • 16.
    SOAP Envelope (Headerand Body) POST /InServicesComputing HTTP/1.1 Host: www.servicescomputing.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: 100 <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap- envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding"> <soap:Header> <m:Payment xmlns:m="http://www.servicescomputing.org/paymen t/" soap:actor="http://www.servicescomputing.org/appm l/"> soap:mustUnderstand="1"> 123 </m:Payment> </soap:Header> <soap:Body> <!-- Request message --> <m:GetPrice xmlns:m="http://www.servicescomputing.org/pr ices"> <m:Item>Proceedings</m:Item> </m:GetPrice> <!-- Response message --> <m:GetPriceResponse xmlns:m="http://www.servicescomputing.org/pr ices"> <m:Price>70</m:Price> </m:GetPriceResponse> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope> 20
  • 17.
    Binding of WSDLto SOAP  A WSDL document defines how to access a service operation using the element binding: the message format and protocol details for each port.  The binding tag has two attributes: the name attribute and the type attribute.  The name attribute defines the name of the binding, and the type attribute points to the port for the binding, in this case it is the “productPrice” port. 21
  • 18.
    Binding of WSDLto SOAP  The tag soap:binding has two attributes: the style attribute and the transport attribute. The style attribute can be either “ RPC (Remote Procedure Call)” or “document.”  The transport attribute defines the SOAP protocol to use, in this example it is “HTTP.” The tag operation defines each operation that the port exposes. For each operation, the corresponding SOAP action needs to be defined. One needs to specify how the input and output messages are encoded. 22
  • 19.
    An example WSDLbinding segment <message name="getPriceRequest"> <part name="productid" type="xs:string"/> </message> <message name="getPriceResponse"> <part name="value" type="xs:string"/> </message> <portType name="productPrice"> <operation name="getPrice"> <input message="getPriceRequest"/> <output message="getPriceResponse"/> </operation> </portType> <binding type="productPrice" name="b1"> <soap:binding style="document" trans- port="http://schemas.xmlsoap.org/soa p/http"/> <operation> <soap:operation soapAction="http://servicescomputing .org/getPrice"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> 23
  • 20.
    Publishing a WebService in Registry  Universal Description, Discovery, and Integration (UDDI) is an ad hoc industry standard that provides a “meta service” for publishing and locating Web services by enabling robust queries against rich metadata.  The UDDI working group includes leading technology vendors, such as IBM, HP, and Microsoft. Detailed information about UDDI can be found at its official Web site at http://www.uddi.org/. 24
  • 21.
    Assignment • What isthe role of WSDL in Web Service Modeling • Explain the usage of SOAP in web service modleing