BladeHal
BladeHal

Reputation: 783

Calling a WCF web service in a Windows application

Sorry for the simple question, but is it possible to reference a web service within a Windows application? The only examples I've seen of web services being referenced has been in ASP.NET apps.

I need to access a web service that would provide data from a remote database.

Thanks

Upvotes: 0

Views: 851

Answers (3)

Grant Thomas
Grant Thomas

Reputation: 45083

Very definitely yes, and in just the same way you would an ASP.NET web application project from within Visual Studio:

  • Open the Solution view,
  • right-click the project,
  • select Add Service Reference from the context menu
  • proceed with configuring the reference

If you're not using Visual Studio (or some other IDE supporting automation of this), and you need to generate the service references manually, you'll want to look into svcutil.

Upvotes: 1

Reed Copsey
Reed Copsey

Reputation: 564323

Yes. Just right click on the "References" in the Solution Explorer, and choose Add Service Reference.... It works the same way in a desktop application.

Upvotes: 3

Related Questions