Powered by Blogger.

Sunday, March 2, 2014

How to use WSDL.exe in Asp.Net?



In this post we will discuss how to generate the wsdl file using wsdl.exe. Also you can check it out Read and write from Text file in Asp.Net, Set default focus in Asp.net and WCF tutorial and example in C#.Net.

WSDL (Web Services Description Language) is an XML-based language for describing Web services and how to access them.

This will generally create a proxy class.
Also you can check out:

- sys.objects type in SQL Server 2008

- List all Stored Procedure Created and Modified in Last N Days in SQL Server 2008

- Get all tables and stored procedures in sql server 2008

The wsdl command line utility is presented in the below location. (For visual studio 2012)

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools

The utility takes different parameter, some examples given below:

wsdl http://URL/Service1.asmx?WSDL

Once you run the above command by default it will generate Service1.cs file in the below location.

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools

You can also change the name of the Service1.cs file like below:

wsdl /out:myProxyClass.cs http://URL/Service1.asmx?WSDL

By default it will use C#.Net language.

You can also generate file in VB.Net like below:

wsdl /language:VB /out:myProxyClass.vb http://URL/Service1.asmx?WSDL