web-services-notes
web-services-notes
Web Services
ELECTIVE COURSE I
1.2 WEB SERVICES
OBJECTIVES:
On successful completion of this subject student should have: understood how to
build real world application using web services
Unit I
Introduction-What are web services-SOAP-WSDL-UDDI Basic web services
standards, technologies and concepts: XML fundamentals: Documents-
Namespaces-schema-processing XML-Simple API for XML(SAX)-Document object
model(DOM)
Unit II
SOAP and WSDL: The SOAP model-SOAP messages-SOAP encoding WSDL:
Structure-The types element-Managing WSDL descriptions-Using SOAP and WSDL
Service implementation and Invoking web services.
Unit III
UDDI: Introduction- UDDI specification - UDDI and lifecycle management.
Conversation: Overview-web services conversation language-WSCL interface
components.
Workflow: Business process management-workflows and workflow management.
Quality of Service: What is QoS- Why is QoS important for web services- QoS
metrics for web services-QoS enabled web services. Mobile and Wireless mobile
services- challenges with mobile.
Unit IV XML and HTML:
The limits of HTML-The scope of HTML-Structure-Structure and Content-
Structure and Synthesis-Structure and Presentation-Representing Structure. The
XML Language: Markup languages-Defining Markup Languages in XML.
Unit V Linking in XML:
Links(Information, Resources, and Hot Spots)-Link Management-Working with
names-Choosing the linking methodology. XML Style: The publishing Process-At
which stage do I structure my data?-Where do I process from one stage to the
next?-When do I Convert?-Publishing data-Choosing a Client-side processing
Application-Choosing a Server-side processing application
Text Book:
1. Sandeep Chatterjee, James Webber, “Developing Enterprise Web Services: An
Architects Guide”, Prentice Hall, Nov 2003
Unit I : Chapter 1 (Pg. 1 to 8), Chapter 2 (Pg.19 to 64)
Unit II : Chapter 3 (Pg. 71 to 86 , 100 – 119)
Unit III: Chapter 4 (Pg. 121 to 122, Pg. 129 , Pg. 137 to 139), Chapter 5 ( Pg.
147-166 )
Chapter 6 (Pg. 177-183), Chapter 9 (Pg. 345– 350, Pg. 364-368) Chapter 10 (Pg.
377-387)
2. Rick Darnell “HTML 4 Unleashed” Techmedia Publication, Second Edition,
Unit IV: Chapter 27 (Pg. 564-591), Chapter 28 (Pg. 606-626)
Unit V: Chapter 29 (Pg. 636-649,660-661) Chapter 30 (Pg. 664-670,672-674)
WEB SERVICES
UNIT 1:
2 MARKS:
Web service is a standardized medium to propagate communication between the client and
server applications on the World Wide Web.A web service is a software module which is
designed to perform a certain set of tasks.The web services can be searched for over the network
and can also be invoked accordingly.When invoked the web service would be able to provide
functionality to the client which invokes that web service.
The above diagram shows a very simplistic view of how a web service would actually work. The
client would invoke a series of web service calls via requests to a server which would host the
actual web service.
These requests are made through what is known as remote procedure calls. Remote Procedure
Calls(RPC) are calls made to methods which are hosted by the relevant web service.
An XML document is a basic unit of XML information composed of elements and other
markup in an orderly package. An XML document can contains wide variety of data. For
example, database of numbers, numbers representing molecular structure or a mathematical
equation.
Simple Type
Simple type element is used only in the context of the text. Some of the predefined simple types
are: xs:integer, xs:boolean, xs:string, xs:date. For example −
<xs:element name = "phone_number" type = "xs:int" />
Complex Type
A complex type is a container for other element definitions. This allows you to specify which
child elements an element can contain and to provide some structure within your XML
documents. For example −
<xs:element name = "Address">
<xs:complexType>
<xs:sequence>
<xs:element name = "name" type = "xs:string" />
<xs:element name = "company" type = "xs:string" />
<xs:element name = "phone" type = "xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
In the above example, Address element consists of child elements. This is a container for
other <xs:element> definitions, that allows to build a simple hierarchy of elements in the XML
document.
Global Types
With the global type, you can define a single type in your document, which can be used by all
other references. For example, suppose you want to generalize the person and company for
different addresses of the company. In such case, you can define a general type as follows −
<xs:element name = "AddressType">
<xs:complexType>
<xs:sequence>
<xs:element name = "name" type = "xs:string" />
<xs:element name = "company" type = "xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
Now let us use this type in our example as follows −
<xs:element name = "Address1">
<xs:complexType>
<xs:sequence>
<xs:element name = "address" type = "AddressType" />
<xs:element name = "phone1" type = "xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
The <any> element enables us to extend the XML document with elements not specified by the
schema.
The following example is a fragment from an XML schema called "family.xsd". It shows a
declaration for the "person" element. By using the <any> element we can extend (after
<lastname>) the content of "person" with any element:
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:any minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Substitution groups are a feature that allows you to declare that an element can be substituted
for other elements in an instance document.
In the example above, the "name" element is the head element and the "navn" element is
substitutable for "name".
<xs:complexType name="custinfo">
<xs:sequence>
<xs:element ref="name"/>
</xs:sequence>
</xs:complexType>
The Simple API for XML (SAX) is a programming interface that acts as an event-based
sequential access parser application programming interface (API) for XML documents. It
provides an abstract interface in which the XML information set (infoset) is processed in a linear
sequence of method calls.
• less expensive to use. This means that if we maintain less number of records or pages
then we will require less no of vendors. Less number of vendors mean less efforts is used
in maintainig and updating the records.
• Data quality Web services protect data from errors which usually comes when working
with database. The data quality web services also improves and increase sales of web
service business.
• One of the advantages of webservices is interoperability. Interoperability Similarly web
service offer interoperability so that on can easily work.
• Implementation is another advantage of web services. If we talk about word
implementation in web services we actually meant to say deployment. Web services are
deployed or arranged over internet technology.
• Application to Application interaction are built on standards such as XML, WSDL,
UDDI, HTTP. These standard solve many communication problems.
Web Services allows different applications to talk to each other and share data
and services among themselves. Other applications can also use the services of the web
services. ... So, Web services is used to make the application platform and technology
independent.
UNIT 2:
SOAP provides the envelope for sending Web Services messages over the Internet/Internet. ...
The SOAP envelope contains two parts: An optional header providing information on authentication,
encoding of data, or how a recipient of a SOAP message should process the message. The body
that contains the message.
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
...
Message information goes here
...
</soap:Envelope>
The SOAP header. The SOAP <Header> is an optional element in a SOAP message. It is used to
pass application-related information that is to be processed by SOAP nodes along the message
path. The
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<UserID xmlns="http://tempuri.org/">jsmith</UserID>
<Password xmlns="http://tempuri.org/">25jeL3n</Password>
</s:Header>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://tempuri.org/">
<ns1:ProcessData></ns1:ProcessData>
</s:Body>
</s:Envelope> child elements of the <Header> element are called header blocks.
SOAP fault is an error in a SOAP (Simple Object Access Protocol) communication resulting from
incorrect message format, header-processing problems, or incompatibility between applications.
SOAP Encoding is an extension of the SOAP framework specification that defines how a data value
should be encoded in an XML format. SOAP Data Model is defined as an adjunct in SOAP 1.2
specification. SOAP encoding offers the following rules to convert any data value defined
in SOAP data model into XML format.
SOAP-RPC defines a model for representing an RPC and an RPC response using
the SOAP infrastructure. It is not necessarily bound tightly to a synchronous request/reply model, or
to the HTTP protocol. ... When using SOAP-RPC, the body of the envelope contains the method
name and the parameters for the procedure call.
<binding> Defines the protocol and data format for each port type
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
</definitions>
<message name="getTermResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
The name attribute (you can use any name you want) defines the name of the
binding, and the type attribute points to the port for the binding, in this case
the "glossaryTerms" port.
UNIT-3
1. What is UDDI?
UDDI is an XML-based standard for describing, publishing, and
finding web services. UDDI stands for Universal Description,
Discovery, and Integration. UDDI is a specification for a distributed
registry of web services. UDDI is a platform-independent, open
framework.
2. Define UDDI specification.
The UDDI specification defines services that support the
description and discovery of: Businesses, organizations and other
providers of Web services; The Web services they make available;
The technical interfaces which may be used to access and manage
those services.
• Deployment
• Execution and monitoring
5. What is WSCL?
Web Services Conversation Language (WSCL) Web Services
Conversation Language (WSCL) allows the business level
conversations or public processes supported by a Web service to be
defined. WSCL specifies the XML documents being exchanged, and
the allowed sequencing of these document exchanges.
7. Define workflow.
Process Workflow.
Case Workflow.
Project Workflow
QoS Metrics for Web Services. QoS metrics are a set of qualitative
measures of how appealing a Web service is for applications that
may potentially consume it.
UNIT-4
HTML Does:
Support multiple
<FONT SIZE=X> </FONT>
text sizes
Support multiple
<FONT Face="XXXX"> </FONT>
fonts
Support bold,
underline, and italic <B></B>, <U></U>, <I></I>
version of text
Have built-in
graphics for line <HR>
rules
Supports itemized
<UL><LI>...<LI>...<LI> </UL> like this
lists with dots or
bulleted list.
numbers
The content attribute gives the value associated with the http-equiv
or name attribute.
9. What is XML?
HTML XML
Static Dynamic
• It is considered as platform-independent.
• It allows communication between diverse applications.
• It uses HTTP protocol for passing information between client
and server computers.
• It has small XML vocabulary for describing request and
response’s nature.
UNIT-5
4. XML WSDL
5. XML Soap
• text
• attributes
• other elements
the user and are used to limit access to proprietary data and
help keep control of the script source code.