Reputation: 5096
While consuming a web service in my application I have two choices(ref. msdn)
2.Adding the Proxy Using a Web Reference in Visual Studio
Now what should I choose, 2nd option is very simple and I generally follow that. I want to know what are the pros and cons of both the options(if any) and ideally what should I choose? Thanks.
Upvotes: 1
Views: 311
Reputation: 7831
Add the reference automaticly when possible, Visual Studio will do everything for you. Under certain scenarios this is not possible. so you will have to do some manual work, like running the command to generate the proxy class and copying some configuration lines into the web.config manually.
Upvotes: 1
Reputation: 72930
They essentially achieve the same thing. The second gets the WSDL from the web service and generates the proxy, which requires the service to be online at the time.
Upvotes: 2