Unit 123 WSDG
Unit 123 WSDG
UNIT 1
Web Service
• A Web service, in very broad terms, is a method of communication
between two applications or electronic devices over the World Wide
Web (WWW)
• Web services are of two kinds: Simple Object Access Protocol (SOAP)
and Representational State Transfer (REST).
• The Web Server architecture includes a set of application services for
various application-specific functions.
• These application services include the following: Security and access
control. Session management service. File system service.
Types of web architecture
1.Monolithic architecture:
This architecture uses one code base in the application to structure a single
component providing high performance. ...
2.Microservices Architecture
3.Serverless Architecture:
Web Service Architecture
• Web Service Architecture –
• Web service architecture refers to the structure and design principles
that govern the implementation of web services using protocols like
WSDL, SOAP, and UDDI to facilitate application integration on the
internet
Web service interacts among three roles
service provider, service requester, and service registry.
The interaction involves the three operations:
publish, find, and bind. These operations and roles act upon the web services
artifacts.
These service requestor uses a find operation to retrieve the service description
locally or from the service registry. It uses the service description to bind with the
service provider and invoke with the web service implementation.
.
Roles in a Web Service Architecture
Service Provider
From an architectural perspective, it is the platform that hosts the services.
Service Requestor
Service requestor is the application that is looking for and invoking or initiating an interaction
.
with a service. The browser plays the requester role, driven by a consumer or a program
without a user interface.
Service Registry
Service requestors find service and obtain binding information for services during development.
Operations in a Web Service Architecture
Find: In the find operation, the service requestor retrieves the service description
directly. It can be involved in two different lifecycle phases for the service requestor:
At design, time to retrieve the service's interface description for program development.
.
And, at the runtime to retrieve the service's binding and location description for
invocation.
Bind: In the bind operation, 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.
Web Service Implementation Lifecycle
Requirements Phase
Analysis Phase
Design Phase
Coding Phase
Test Phase
Deployment Phase
.
Features/Characteristics Of Web Service
(a) XML Based: The information representation and record transportation
layers of a web service employ XML. There is no need for networking, operating
system, or platform binding when using XML. At the middle level, web offering-
based applications are highly interoperable.
(b) Loosely Coupled: A customer of an internet service provider isn’t
necessarily directly linked to that service provider
(c) Capability to be Synchronous or Asynchronous: Synchronicity refers to
the client’s connection to the function’s execution.
Asynchronous clients get their results later, but synchronous clients get their
effect immediately when the service is completed.
.
(e) Supports Remote Procedural Call: Consumers can use an XML-based
protocol to call procedures, functions, and methods on remote objects utilizing
web services. A web function can support RPC by offering its own services, n.
(f) Supports Document Exchanges: One of XML’s most appealing features is
its simple approach to communicating with data and complex entities. These
records can be as simple as talking to a current address or as complex as
Building blocks of web
A typical Web services architecture-based solution relies on de facto Web-
services standards such as XML, SOAP, WSDL, and UDDI, and on industry-
standard protocols such as HTTP and SMTP. These standards-based
technologies form the foundation for building a Web services architecture and
enabling Web services.
services?
.
Building blocks of web
XML
A general-purpose specification for creating custom markup languages. XML is
used to communicate between web services across standard protocols like
HTTP, TCP/IP, SMTP, or FTP.
SOAP
Simple Object Access Protocol is a lightweight protocol that uses XML to
exchange information between distributed applications. SOAP uses a standard
services?
.
Basic steps for implementing web services are
Create an application: Create a new application
Specify the proxy server address: Specify the address of the application
proxy server
Create a web service reference: Create a web service reference by supplying
the location of a WSDL document or by creating it manually
Use SOAP
.
SOAP is a standard that allows web services to be accessed using internet
technologies. SOAP specifies a package of XML documents that can be
transported using internet protocols like HTTP(S) and SMTP.
Basic steps for implementing web services are
Creating Web Service References.
.
Basic steps for implementing web services are
Use a services oriented architecture (SOA)
SOA allows for the flexible and standardized sharing or connecting of data and
resources.
.
Non functional service description?
Hosting environment: The security policy, quality of service levels, and privacy
policy
Message syntax: How the service impacts the syntax of the message
.
WSDL Document
A WSDL document has a definitions element that contains the other five
elements, types, message, portType, binding and service.
The following sections describe the features of the generated client code.
WSDL supports the XML Schemas specification (XSD) as its type system.
.
WSDL Document
.
WSDL Binding
A WSDL binding describes how the service is bound to a messaging protocol,
particularly the SOAP messaging protocol. A WSDL SOAP binding can be
either a Remote Procedure Call (RPC) style binding or a document style
binding.
.
WSDL Binding
soap:binding: This element denotes that SOAP will be used to make the
binding available. The SOAP message format’s overall style is indicated via the
style attribute. An RPC format is specified by a style value of rpc.
soap:body: You can define the specifics of the input and output messages
.
using this element. In the case of HelloWorld, the body element defines the
namespace URN connected to the requested service as well as the SOAP
encoding type.
WSDL Binding
<input>
<soap:body encodingStyle = "..." namespace =
</input>
<output>
.
"urn:examples:Greeting" use = "encoded"/>
<soap:body
encodingStyle = "..."
namespace = "urn:examples:Greeting" use = "encoded"/>
</output>
</operation>
</binding>
WSDL Tools
WSDL tools are used to create, edit, and test Web Services Description
Language (WSDL) files. WSDL tools can also help you generate documentation
for your WSDL files.
WSDL editor
A tool that allows you to browse, edit, and validate WSDL files. WSDL editors
can provide a graphical view of WSDL files, as well as a view that shows the
WSDL content as an XML file.
Output mapping: WSDL does not support output mapping, which is the header
in a response
MIME and HTTP operations: WSDL only considers SOAP operations and
ignores MIME and HTTP operations
.
Mixed type messages: WSDL does not support mixed type messages
<wsdl:include> and <wsdl:types> elements: A WSDL file cannot have both a
<wsdl:include> and a <wsdl:types> element
SOAP-encoded structures and arrays: WSDL does not support SOAP-
encoded structures and SOAP-encoded arrays
UNIT-2
XML DOCUMENT STRUCTURE
.
XML DOCUMENT STRUCTURE
.
XML DOCUMENT STRUCTURE EXAMPLE
1.<?xml version="1.0"?>
2.<college>
3. <student>
4. <firstname>Tamanna</
firstname>
5. <lastname>Bhatia</lastname>
6. <contact>09990449935</
contact>
7. <email>tammanabhatia@abc.co
m</email>
8.
9.
10.
<address>
.
<city>Ghaziabad</city>
<state>Uttar Pradesh</
state>
11. <pin>201007</pin>
12. </address>
XML DOCUMENT STRUCTURE EXAMPLE
The image above represents books in this XML:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
.
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
XML Namespaces
Name Conflicts
In XML, element names are defined by the developer. This often results in a
conflict when trying to mix XML documents from different XML applications.
This XML carries HTML table information:
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>
<table>
<name>African Coffee Table</name>
.
This XML carries information about a table (a piece of furniture):
<width>80</width>
<length>120</length>
</table>
XML Namespaces
Solving the Name Conflict Using a Prefix
Name conflicts in XML can easily be avoided using a name prefix.
This XML carries information about an HTML table, and a piece of furniture:
<h:table>
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
<f:table>
.
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
XML Namespaces
XML Namespaces - The xmlns Attribute
When using prefixes in XML, a namespace for the prefix must be defined.
The namespace declaration has the following syntax. xmlns:prefix="URI".
<root>
<h:table xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
.
<f:table xmlns:f="https://www.w3schools.com/furniture">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
</root>
XML XML Schema
The XML Schema language is also referred to as XML Schema Definition (XSD).
XSD Example
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
</xs:sequence>
</xs:complexType>
.
<xs:element name="body" type="xs:string"/>
</xs:element>
</xs:schema>
XML Documentation and Navigation
All nodes have exactly one parent node. The following code navigates to the
parent node of <book>
Example
function myFunction(xml) {
var xmlDoc = xml.responseXML;
var x = xmlDoc.getElementsByTagName("book")[0];
document.getElementById("demo").innerHTML = x.parentNode.nodeName;
}
.
SOAP
Simple Object Access Protocol (SOAP) is a protocol for exchanging information
between applications over the internet.
It's an XML-based protocol that's often used to implement web services.
SOAP messages are sent from a sender to a receiver
SOAP messages are made up of an envelope, header, and body.
•The envelope is the root element of the message and identifies it as
a SOAP message.
•The header is optional and contains application-specific
information.
•The body contains the message being transported, including the
data and operation being invoked.
.
•SOAP messages can be combined to perform request/response
patterns.
SOAP
Envelope: This specifies that the XML message is a SOAP message. A SOAP
message is an XML document containing a header and a body, both
encapsulated within the envelope. Any fault is included within the body of the
message.
Header: This part is optional. When present, it can provide crucial information
about the applications.
Body: This contains the actual message being transmitted. Faults are contained
within the body tags.
.
Fault: This optional section contains the status of the application and any errors.
It should not appear more than once in a SOAP message.
SOAP
Content-Type: application/soap+xml
<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap
-envelope">
<env:Header> <m:GetLastTradePrice
xmlns:m="Some-URI" />
</env:Header>
<env:Body>
.
<symbol xmlns:p="Some-URI" >DIS</symbol>
</env:Body>
</env:Envelope>
SOAP
Works
SOAP messages are encoded in XML, which makes them portable and
system-independent.
SOAP uses the same error and status codes as HTTP so that HTTP responses
can be directly interpreted by a SOAP module. Wire protocols
.
HTTP: The most common protocol used to transmit SOAP
messages. HTTP is an application layer protocol that is part of the
existing internet infrastructure.
HTTPS: Another protocol that can be used to transmit SOAP
SOAP
SOAP Message Structure
The following block depicts the general structure
of a SOAP message −
<?xml version = "1.0"?> <SOAP-ENV:Envelope
xmlns:SOAP-ENV =
"http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle =
"http://www.w3.org/2001/12/soap-encoding">
<SOAP-ENV:Header> ... ... </SOAP-
.
ENV:Header> <SOAP-ENV:Body> ... ... <SOAP-
ENV:Fault> ... ... </SOAP-ENV:Fault> ...
</SOAP-ENV:Body> </SOAP_ENV:Envelope>
SOA Enterprise service bus
.
<Message>, <Code>, <ErrorCode>, and <ErrorMessage>.
The <ErrorCode> element contains an error code, and the
<ErrorMessage> element contains a string describing the error.
UNIT-3
.
SOAP Registering and discovering Service
Service registration and discovery is the process of registering a
service's location in a central registry and then using that
information to find other services.
This process enables services to communicate with each other
without hardcoded addresses.
Service registry: A centralized database that stores information
about services and their locations
Service discovery: The process of finding services using the
service registry
Service registration: The process of registering a service's
.
location in the service registry
SOAP Role of Service Registering
Store information: Service registries store information about
services, such as schemas, artifacts, and API specifications
Find services: Developers can use service registries to find
services that they can reuse in their applications.
Validate schemas: Service registries can validate schemas and
detect errors in data.
Enforce rules: Service registries can enforce rules for service
communication.
Enable service composition: Service registries can help
developers locate services for reuse and enable service
composition.
.
Enable dynamic interaction: Service registries can store
service descriptions that runtimes use to enable dynamic
interaction between services.
SOAP Service Discovery
Service discovery is the process of automatically finding and
connecting devices and services on a network. It's used to
reduce the amount of manual configuration required by
administrators and users.
Service catalog
A service catalog stores a record of all services in a network. It acts
as a single source of truth that allows services to communicate and
query each other.
Service registry
Service location
.
UDDI
Universal Description, Discovery, and Integration (UDDI) is a
service that helps users find web services and web service
providers. It uses XML to describe and discover web services in
an internet topology.
How UDDI works
•Publish information
Businesses register with a UDDI registry and publish information about their we
•Search for services
Users can search for services by keyword, category, or business name
•Evaluate service details
Users can review technical information and other details to determine if the ser
•Integrate the service
.
Users can use binding templates to integrate the service into their application o
UDDI ARCHITECTURE
Service discovery is the process of automatically finding and
connecting devices and services on a network. It's used to
reduce the amount of manual configuration required by
administrators and users.
Service catalog
A service catalog stores a record of all services in a network. It acts
as a single source of truth that allows services to communicate and
query each other.
Service registry
Service location
.
UDDI ARCHITECTURE
.
UDDI ELEMENTS
UDDI Specification: It consists of UDDI Operators, UDDI
Programmer's API (API defines sets function that uddi registry
support e.g. publishing data) and UDDI Data Structures (such as
XML structures). Now a days UDDI Version 3.0.2 is mostly used it
describes the Web services and UDDI registry.
UDDI Schema: Schema is an abstract representation of an object's
characteristics and relationship that can describe another
objects. This means that uddi schema defines resources and
characterstics and relationship of another resources.
UDDI Regitery: UDDI Business Registry also called as UBR. UBR
.
consist of multiple business registry that synchronize uddi data
through replication. UDDI Registry is one by which web services list
themselves on the internet.
UDDI DATA MODEL
Universal Description, Discovery, and Integration
(UDDI) specification defines a way to publish and
discover information about Web services.
UDDI has two functions: It is a SOAP-based protocol
that defines how clients communicate with UDDI
registries. It is a particular set of global replicated
registries.
.
UDDI DATA MODEL
.
.
UDDI DATA MODEL
.
UDDI includes an XML Schema that describes the following data
structures −
• businessEntity
• businessService
• bindingTemplate
• tModel
• publisherAssertion
businessEntity Data Structure
The business entity structure represents the provider of web
.
services. Within the UDDI registry, this structure contains
information about the company itself, including contact
information, industry categories, business identifiers, and a list of
services provided.
UDDI DATA MODEL
.
.
UDDI DATA MODEL
.
.
UDDI UDDI - Interfaces
The
. Publisher Interface
get_authToken − Retrieves an authorization token. All of the Publisher
interface operations require that a valid authorization token be
submitted with the request.
• discard_authToken − Tells the UDDI registry to no longer accept a
given authorization token. This step is equivalent to logging out of the
system.
• save_business − Creates or updates a business entity's information
contained in the UDDI registry.
• save_service − Creates or updates information about the web
services that a business entity provides.
• save_binding − Creates or updates the technical information about a
web service's implementation.
save_tModel − Creates or updates the registration of abstract concepts managed
by the UDDI registry.
delete_business − Removes the given business entities from the UDDI registry
UDDI UDDI - Interfaces
The
. Publisher Interface
delete_service − Removes the given web services from the UDDI registry
completely.
delete_binding − Removes the given web services technical details from the UDDI
registry.
delete_tModel − Removes the specified tModels from the UDDI registry.
get_registeredInfo − Returns a summary of everything the UDDI registry is
currently keeping track of for the user, including all businesses, all services, and all
tModels.
set_publisherAssertions − Manages all of the tracked relationship assertions
associated with an individual publisher account.
add_publisherAssertions − Causes one or more publisherAssertions to be added
to an individual publisher's assertion collection.
delete_publisherAssertions − Causes one or more publisherAssertion elements
to be removed from a publisher's assertion collection.
UDDI UDDI - Interfaces
T
. he Publisher
Interface
get_assertionStatusReport − Provides administrative support for determining the
status of current and outstanding publisher assertions that involve any of the
business registrations managed by the individual publisher account.
get_publisherAssertions − Obtains the full set of publisher assertions that is
associated with an individual publisher account.
UDDI UDDI - Interfaces
. he Inquiry Interface
T
find_binding − Returns a list of web services that match a particular set of criteria
based on the technical binding information.
find_business − Returns a list of business entities that match a particular set of
criteria.
find_ltservice − Returns a list of web services that match a particular set of
criteria.
find_tModel − Returns a list of tModels that match a particular set of criteria.
get_bindingDetail − Returns the complete registration information for a particular
web service binding template.
UDDI UDDI - Interfaces
. he Inquiry Interface
T