Sunday 30 March 2008

Programming Webservices using WSDL (Without WebReference)


WSDL stands for Web Service Description Language, a standard by which a web service can tell clients what messages it accepts and
which results it will return. WSDL contains every details regarding using web service


  1. Method and Properties provided by web service

  2. URLs from which those method can be accessed.

  3. Data Types used.

  4. Communication Protocol used.


This post will help you to program with WSDL without using webservice reference. In brief following are the steps you need to take.


Create the proxy class using the tool WSDL.exe* (this can be accessed using Visual Studio.NET command prompt).


Following is the syntax of the wsdl.exe command you can use to generate the proxy class.

wsdl.exe  <options><url><url>...



for e.g: wsdl myservice.wsdl -language:cs


Based on the schema of myservice.wsdl this Utility will generate the proxy class myservice.cs in c# in the current directory.
You can use lots of other options also, you can find the options by using the command wsdl /? in command prompt.


If you want, you can also generate the VB class file by using the command
wsdl myservice.wsdl -language:vb


You can create a project or use the existing project now and add the class in your project,
thats it :) now you are ready to create the instance of the class, call methods, etc.



I hope this is helpful, if you need more detail please leave a comment, I will try to answer.


Also if you are very new to webservice you can browse this site,

I found this very helpful for beginners :
All About Web Service in .Net


And some of the good sites which can give you more indepth knowledge.


Creating and Consuming .NET Web Services in Five Easy Steps


Creating a .NET Web Service - By Chris Peiris


Programming .NET Web Services -O'Reilly




*WSDL.exe is the utility to generate code for xml web service clients and xml webservices using ASP.NET from WSDL contract files,
XSD schemas and .discomap discovery documents. This tool can be used in conjunction with disco.exe.
Share:

0 comments:

Post a Comment