Paul Brown
Paul Brown

Reputation: 5016

SOAP Web Service / VS2010 Add Service Reference

I am having problems gaining access to a clients web service online.

If I have the wsdl file, can I do "something" in VS2010 with it so I can add it as a reference and start my C# coding?

Thanks Paul

Upvotes: 10

Views: 18639

Answers (3)

Taersious
Taersious

Reputation: 779

Adding the Service Reference as a local path worked for me like a charm. I would have voted +1 for xelco52, but my rep is too low...

Only 1 issue; one of my members of the class I've added does not work. I wonder if I need to use the sledgehammer...?

Upvotes: 3

xelco52
xelco52

Reputation: 5347

When you go to "Add Service Reference", the textbox that allows you to enter a URL, can also take a path on your local filesystem to a wsdl.

Additionally, while not the optimal route, you can also use the wsdl.exe/svcutil.exe utility (bundled with VS) to generate a proxy class. Adding a reference is the better way to go, but this is an additional option.

Upvotes: 27

KeithS
KeithS

Reputation: 71591

If you have the WSDL file, under one of your projects in VS, right-click the References project folder and choose Add Service Reference. Click the Advanced button, and in the new dialog click Add Web Reference. Now, go find the WSDL file, either where you saved it or where you downloaded it, enter its location in the textbox, and click Go. VS will digest the WSDL and produce a class that is the service client, and others as necessary to implement custom types accepted by the service.

It's usually a good idea, if you have downloaded the WSDL, to include it as an item in the project that has the web reference; that allows it to be easily traversed as a reference source, and to be located should you need to recreate the web service classes.

Upvotes: 0

Related Questions