web services

3
Palle Technologies: XML Webservices Creating a Proxy Class and Consuming the Webservices from the Clients: We have 2 methodologies of creating clients 1. Add webrefernce 2. Creating proxy by using WSDL.EXE After creating the Webservice Right click on .asmx file and Click on Browse Copy the url. Open VS2008 Command prompt. Follow the steps given in the below given screen shot. How WebServices will be called from a Proxy:

Upload: mohitkumar1985

Post on 08-Jul-2015

33 views

Category:

Software


0 download

DESCRIPTION

Here i am giving notes for creating webservices i hope this will be

TRANSCRIPT

Page 1: Web services

Palle Technologies: XML Webservices

Creating a Proxy Class and Consuming the Webservices from the Clients:

We have 2 methodologies of creating clients

1. Add webrefernce

2. Creating proxy by using WSDL.EXE

• After creating the Webservice Right click on .asmx file and Click on Browse

• Copy the url.

• Open VS2008 Command prompt.

• Follow the steps given in the below given screen shot.

How WebServices will be called from a Proxy:

Page 2: Web services

Palle Technologies: XML Webservices

WSDL is usefull in generating the Proxy class:

• WSDL stands for Webservices description Language.• WSDL is written in XML • WSDL is an XML document • WSDL is used to describe Web services • WSDL is also used to locate Web services

WSDL Contains the below elements:

WSDL PortsThe <portType> element is the most important WSDL element. It describes a web service, the operations that can be performed, and the messages that are involved.The <portType> element can be compared to a function library (or a module, or a class) in a traditional programming language.

WSDL MessagesThe <message> element defines the data elements of an operation.Each message can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language.

Page 3: Web services

Palle Technologies: XML Webservices

WSDL TypesThe <types> element defines the data types that are used by the web service.For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.

The WSDL Document StructureA WSDL document describes a web service using these major elements:Element Description<types> A container for data type definitions used by the web service<message> A typed definition of the data being communicated<portType> A set of operations supported by one or more endpoints<binding> A protocol and data format specification for a particular port type

The main structure of a WSDL document looks like this:<definitions>

<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> A WSDL document can also contain other elements, like extension elements, and a service element that makes it possible to group together the definitions of several web services in one single WSDL document.

WSDL BindingsThe <binding> element defines the message format and protocol details for each port.