Friday, June 19, 2009

Creating Proxy Class with Visual Studio .NET 2005

Creating Proxy Class with Visual Studio .NET 2005
Visual Studio .NET 2005 provides the capability to create class files that contain the proxy code utilized to access the web services. The WSDL tool is used to generate proxy code from WSDL files. The generated class is used to instantiate objects for communicating with the Web services via SOAP messages.

Creating Proxy Class in C#
1) From within your Visual Studio 2005 folder in your start menu, select "Visual Studio Tools"

2) Within the "Visual Studio Tools" menu select "Visual Studio 2005 Command Prompt".

Note
This shortcut automatically loads up all of the environment variables needed to access special tools in Visual Studio .Net without having to specially modify the operating system variables.

3) Within the command prompt, change the directory to the directory of your application.

Note
If you do not change your directory, the default location for your file will be:


C:\Program Files\Microsoft Visual Studio 8\VC
4) Within the command prompt window, type the following command:


wsdl http://jlab.calumet.purdue.edu/thegateway/v2/0/pathwaygateway.asmx?wsdl
Note The filename "GatewayPathway.CS" will be in the location you specified in step 3.

5) Within your Visual Studio 2005 project, open Solution Explorer.

6) Within the Solution Explorer right click on the project name and select "Add Existing Item..." and the "Add Existing Item" dialog box will appear


7) Within the "Add Existing Item" dialog box, browse to the location of your file if not in the project folder, and select the file "PathwayGateway.cs" you created in step 4.

Note
The File has now been added to your project and will be listed in your Solution Explorer.

Creating Proxy Class in VB.NET
1) From within your Visual Studio 2005 folder in your start menu, select "Visual Studio Tools"

2) Within the "Visual Studio Tools" menu select "Visual Studio 2005 Command Prompt".

Note
This shortcut automatically loads up all of the environment variables needed to access special tools in Visual Studio .Net without having to specially modify the operating system variables.

3) Within the command prompt, change the directory to the directory of your application.

Note
If you do not change your directory, the default location for your file will be:

C:\Program Files\Microsoft Visual Studio 8\VC
4) Within the command prompt window, type the following command:


wsdl http://jlab.calumet.purdue.edu/thegateway/v2/0/pathwaygateway.asmx?wsdl /language:VB
Note The filename "GatewayPathway.vb" will be in the location you specified in step 3.

5) Within your Visual Studio 2005 project, open Solution Explorer.

6) Within the Solution Explorer right click on the project name and select "Add Existing Item..." and the "Add Existing Item" dialog box will appear


7) Within the "Add Existing Item" dialog box, browse to the location of your file if not in the project folder, and select the file "PathwayGateway.VB you created in step 4.

Note
The File has now been added to your project and will be listed in your Solution Explorer.

No comments:

Post a Comment