Specializations

Thursday, January 3, 2013

WEB SERVICE


Web Services

What is a Web Service?
Web Services are business logic components which provide functionality via the Internet using standard
protocols such as HTTP. Web Services uses Simple Object Access Protocol (SOAP) in order to expose
the business functionality.SOAP defines a standardized format in XML which can be exchanged between
two entities over standard protocols such as HTTP. SOAP is platform independent so the consumer of
a Web Service is therefore completely shielded from any implementation details about the platform
exposing the Web Service. For the consumer it is simply a black box of send and receive XML over
HTTP. So any web service hosted on windows can also be consumed by UNIX and LINUX platform.
What is UDDI?
Full form of UDDI is Universal Description, Discovery and Integration. It is a directory that can be used
to publish and discover public Web Services. If you want to see more details you can visit the http://
www.UDDI.org
What is DISCO?
DISCO is the abbreviated form of Discovery. It is basically used to club or group common services
together on a server and provides links to the schema documents of the services it describes may require.
What is WSDL?
Web Service Description Language (WSDL)is a W3C specification which defines XML grammar for
describing Web Services.XML grammar describes details such as:-
1. Where we can find the Web Service (its URI)?
2. What are the methods and properties that service supports?

3. Data type support.
4. Supported protocols.
In short its a bible of what the webservice can do.Clients can consume this WSDL and build proxy
objects that clients use to communicate with the Web Services. Full WSDL specification is available
athttp://www.w3.org/TR/wsdl.
What the different phase/steps of acquiring a proxy object in Webservice?
Following are the different steps needed to get a proxy object of a webservice at the client side :-
1. Client communicates to UDI node for WebService either through browser or UDDI's public web
service.
2. UDII responds with a list of webservice. 166
3. Every service listed by webservice has a URI pointing to DISCO or WSDL document.
4. After parsing the DISCO document, we follow the URI for the WSDL document related to the
webservice which we need.
5. Client then parses the WSDL document and builds a proxy object which can communicate with
Webservice.
What is file extension of Webservices?
ASMX is extension for Webservices.
Which attribute is used in order that the method can be used as WebService?
WebMethod attribute has to be specified in order that the method and property can be treated as
WebService.
Do webservice have state?
Webservices as such do not have any mechanism by which they can maintain state. Webservices can
access ASP.NET intrinsic objects like Session, application and so on if they inherit from "WebService"
base class.
<%@ webservice class="TestWebServiceClass" % >
Imports System.Web.Services
Public class TestWebServiceClass Inherits WebService <webmethod>
Public Sub SetSession(value As String)
session("Val") = Value
End Sub
End Class
Above is a sample code which sets as session object called as "val". TestWebserviceClass is inheriting
from WebService to access the session and application objects.

No comments:

Post a Comment