It seems that there are two methods for auto generating web service proxies in VS2008 from a wsdl.
- wsdl.exe
- Adding a web 开发者_运维知识库reference/service reference from the interface
I've been using wsdl.exe because I like having access to the class - and when I add a reference, I haven't been able to find the generated proxy code. Is there a benefit of just adding a reference that I may be overlooking?
Adding a service reference is the way to go. As pointed out to me on another thread, it is prudent that I strongly encourage you to avoid using wsdl.exe unless you have a very good reason to be using it. For your reference, the VS option Add Web Reference is a wrapper over wsdl.exe and creates proxies for .NET 1.1 or 2.0 clients. Add Service Reference is a wrapper over svcutil.exe and is used to create .NET 3.0+ clients.
精彩评论