Thomas
Thomas

Reputation: 34208

How to generate proxy class from WSDL in case of webservice

suppose when i have only wsdl file then how can i create proxy class just to call webservice various method. how webservice related all class and its property & method will be exposed in my c# apps. can anyone help guiding me. thanks

Upvotes: 14

Views: 69975

Answers (4)

VRK
VRK

Reputation: 400

You can use WSDL.exe tool using command line.

i.e. WseWsdl3 WSDLPath /out:MyProxyClass.cs

Upvotes: 3

user2045407
user2045407

Reputation: 121

if WseWsdl3.exe is unable to create the proxy class, there is still a way.

If you can run your service as a regular ASP.NET web application in IIS, it creates temporary ASP.NET files where the proxy class is nicely generated for you.

You can find it in folder:

C:\Windows\Microsoft.NET\Framework\vMAJOR.MINOR.BUILD\Temporary ASP.NET Files\YOUR_WEB_APP.

There are some subfolders with random names, go to most recent one and look something like "App_WebReferences.XXXX.0.cs".

Upvotes: 1

lesscode
lesscode

Reputation: 6361

You would need to use the ServiceModel Metadata Utility Tool, or Visual Studio's Add Service Reference Dialog in order to generate a client proxy for the service with which you want to communicate. The generated proxy will provide classes that abstract the service contract, and you can program your client applications to interact with these classes.

Upvotes: 8

Varius
Varius

Reputation: 3407

There is an utility, it shipps with Visual Studio (since 2005, I think), called wsdl.exe

It's commandline, and can be used to generate proxy.

Upvotes: 8

Related Questions