V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA
BCA DEPARTMENT
Chapter No :6
Web Services Development
Web Services is the term currently being used to describe hosted applications because many of
them are hosted on the same servers used for websites, and their function is to provide services
to (in most cases) any user, human, or machine across the Internet (but this doesn't mean that
users can't be restricted, just as in any online situation). The development process is just about
the same as for any type of programming: determine the desired result, figure out what inputs
are required, generate the logic to perform the processing, and finally, do the coding. Web
Services are typically smaller, self-contained applications that perform specific functions rather
than all-encompassing programs that do everything in
What is extensible Markup Language (XML)?
XML is a very hot topic these days because it provides an excellent format for packaging and
communicating data between humans, machines, or both. It is important to note that XML is
not a language. It is a standard format for writing your own languages. These languages
resemble HTML in that they are made up of elements and attributes surrounded by angle
brackets (<, >), so they tend to be easy to read and to write by hand. Both HTML and XML are
subsets or applications of SGML (Standard Generalized Markup Language). Technically, XML is an
application profile written with and conforming to SGML.
The World Wide Web Consortium (W3C) developed XML 1.0 with the design goals that it be usable
on the Internet, provide support for many applications, be compatible with SGML, be easy to
use, have no optional features, be human-readable, and be concise.
XML Entities
XML entities are like XML "pages," in the same way that plain-text HTML files are web
pages. XML documents are composed of one or more entities (the recommendation refers
to entities as storage units) containing parsed or unparsed data. The parsed data includes
text and markup. The markup tags describe the layout and structure of the document. An
XML processor reads XML documents and typically provides the results to an application.
Microsoft's Internet Explorer 5.0 supports XML 1.0 processing as well as namespaces and
the DOM and includes an engine for processing extensible Style Sheets (XSL), an XML version
of Cascading Style Sheets (CSS).
Dr.Krunal Bhavsar
Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA
BCA DEPARTMENT
The XML Document Structure
XML documents have two structures, one logical and the other physical. All the files or
entities that make up the XML document, even though they might be physically separated, are
included in the finished XML document. Logically, the document consists of elements,
attributes, and so on, much like an HTML document, although XML documents can contain
declarations, processing instructions, and so forth, more like a traditional executable application.
Well-formed XML documents are created from well-formed subunits, including entities,
elements, and so forth.
Web services
A web server is an entry that can be programmed to provide
a particular functionality to any number of applications over the
internet. The functionality provided by web the services can be
used by any application irrespective if the programmed language
in which the application is created or the application is
running.
A web service does not have any interface .it just provide
specific service to consumer also, it provide a high degree of
abstraction between the consumer & the provider of web service.
Benefits of web service: -
1. Web service is simple because of which they can be
implemented on varied platform.
2. Web services are loosely coupled because of which their
interface & method can be extended.
3. Web services do not carry any state into with them.
4. Web services are not affected by firewalls.
Web services are most appropriate to be used while
communication across cross platforms or enforcing trusted
connections between server & the client. It’s a good choice to
use web services while:
1. Using caching feature of asp.net
2. Using SSL security or window authentication
3. Interacting with third party systems.
Dr.Krunal Bhavsar
Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA
BCA DEPARTMENT
A web service can be a crossed by any application regardless
of the s/w & h/w platform on which the app. is running because it
complies with common industry standards, such as simple object
access protocol (soap) & web services description language.
1. Simple object access protocol[SOAP]:
Soap allows your web service to communication with other web
application over the internet soap specifies a format the XML
message using which the web application requests & receive web
also termed as soap message.
Soap message are transmitted over the web application using
the HTTP protocol this is because .the HTTP is a slandered
protocol which is supports by almost every operating system used
no ward also, the mechanisms for securing & monitoring HTTP are
already define.
The two features that makes soap a widely used protocol are
support for remote procedure calls a& platform independency .in
RPC, a remote web application sends a soap message that contain a
request to procedure of the web service.
The soap message also contains the parameter that are to be
passed to the procedure while accessing it when the web server
running the web service & received the message .it sends the
result of the procedure to the web application.
The platform independent feature of soap allows a web service
to communication with various apps, irrespective of hardware a
soft ware platform on which they are running.
Writing VB.NET applications has made it clear that creating
functions and objects in code is a common way to encapsulate
programmatic functionality into an easy-to-use structure that
can be called from just about anywhere in the application,
depending upon the scope of the function or object. The
environment or platform on which the application runs provides
the capability to make the calls, but suppose you'd like to
Dr.Krunal Bhavsar
Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA
BCA DEPARTMENT
make a call to a function or object residing on another
machine somewhere else on the Internet, perhaps even running
on another platform?
SOAP is one of the more popular mechanisms used to wrap calls
to objects for delivery and receipt over the Internet. It is
an XML-based protocol that is designed for providing all the
information necessary to make and receive calls to objects
across the Internet. The latest specification (SOAP 1.2, a
working draft dated July 9, 2001, at www.w3.org) says SOAP is
"a lightweight protocol for exchange of information in a
decentralized, distributed environment. It is an XML-based
protocol that consists of four parts: an envelope that defines
a framework for describing what is in a message and how to
process it, a set of encoding rules for expressing instances
of application-defined data types, a convention for
representing remote procedure calls and responses, and a
binding convention for exchanging messages using an underlying
protocol."
2. Web service description language[WSDL]
WSLD allows consumers of a web service to know about the web
service before interacting with it, it describes all the into
required to use a web service.
a) Operating: - They refer to the mechanism used by the web
service to exchange message with the consumers of the web
service .the operation of similar type are grouped to from
interface.
b) Binding: - They refer to the protocol used by the web
service to interact with the consumers of the web service.
it also refers to refers to the mechanism . Such as also
header & error codes, used by the protocol to enable
communication between web service & web service consumer.
c) End point: - they refer to the location of binding.
WSPL describes a web service with the help of XML
therefore, you can use WSPL to describe a web service that can
be used by the application create using disparate platform &
programming Language.
Dr.Krunal Bhavsar
Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA
BCA DEPARTMENT
A document in which a web service is described using WSPL is
called WSPL document
E.g.: - Definition
Name=”new web service”
Target name space=”http\\ new web service .com”
xmls=”http:// schemas, xmlsoap.org /wsd //”
>
<types>_ _ _ _ _
<message>_ _ _ _
<port type>_ _ _
<binding>_ _ _ _
<service>_ _ _ _
<\definition>
The <type>, <message>, <port type> describes the program logic
for the web service. The <binding> & <service> provides detail
about thing other than the code of the web service, such as
communication protocol & address of the binding.
1. <Type>: - Describes the data types used in web service.
2. <Message>: - Describes the message require by web service
to communication with consumers of web service.
3. <Interface>: - Describes the interface.
4. <Binding>: - Described how a protocol can be used with a
particular interface.
5. <Service>: - Provides details of the end point & parts.
Universal Description, Discovery, and Integration (UDDI)
If you built the services yourself, you'd know where they were
and what they do. If not, there is a mechanism to ease the
discovery and description process: Web Services directories can
provide one area in which the developer can list information
about the Web Services available on the site. UDDI specifications
Dr.Krunal Bhavsar
Ph.D in CS,MCA,B.Sc,CCNA,DCA
V S PATEL COLLEGE OF ARTS & SCIENCE ,BILIMORA
BCA DEPARTMENT
(find out more at www.uddi.org) form a standard set of
instructions for the publishing and discovery of Web Service.
Adding Web References
In VS.NET (and .NET in general), when you write an application using managed code, you'll add
web references that give you a connection to Web Services via a proxy class. What this proxy
class does is serve as a local representation for the method in your code, so that you can code
up your application just like normal, and at runtime the proxy class handles all the
communications across the Internet to and from the Web Service.
To add a web reference (as you will do in Project 7-3), you open a browser-type interface that
searches the URL you enter for WSDL documents. Using the WSDL documents it finds, it makes
available any methods that are exposed by the Web Service.
Dr.Krunal Bhavsar
Ph.D in CS,MCA,B.Sc,CCNA,DCA