Should I add a service reference or a web reference?
I could not think of a better way to title this question. my apologies :)
Anyways, so I have been given a url to a service that I am to consume. There is no information that I have on this service as yet, and so before I ask the clients any dumb questions, I want to know if it really matters if I am consuming this service by adding it to my project as a web reference or a service reference?
When adding as a service reference I won't be checking that box that allows to generate async methods. 开发者_如何学CDoes this mean that in this case both the service reference's proxy class and the web reference's proxy class are fundamentally the same?
Thanks for your time...
Service reference is backwards compatible with web reference (service reference being the new, 2008/2010 WCF proxy way of consuming a service).
You can call any SOAP 1.1 web service with service reference. Web reference may be more simple for somebody unfamiliar with either to configure, but the WCF client is more configurable.
You should have a WSDL file that defines the web service. If that URL generates a WSDL file (you can try going to the URL in a web browser) then it can be used to generate the service reference. You should definitely use the WCF framework for any web service related programming in .Net 3.0 onwards. So I would say that use a service reference. WCF is a more customisable, interoperable and peforming framework and is in fact the base for all other distributed computing initiative from Microsoft in recent times (like OData, RIA services etc.)
精彩评论