Long time ago, in a world far far away, we used to be able to add web service references to projects simply by right-clicking on the project's References node, and clicking "Add Service Reference". I used to be able to do this with .asmx services, and traditional WCF service.
When I follow different online instructions on "making my WCF RESTful", do I also lose the ability to "Add Service Reference" to those WCF services? Can WCF based REST services be added this way?
If I use Web API 2, can I "Add Service Reference"?
Assume I'm using the latest of everything - VS2015, etc.
You can use WCF to build RESTful services in . NET. REST (Representational State Transfer) is an architecture paradigm that conforms to the REST architecture principles. The REST architecture is based on the concept of resources: It uses resources to represent the state and functionality of an application.
WCF has the option to send the response in JSON object. This can be configured with the WebGet or WebInvoke attribute and the WebHttpBinding. This allows you to expose a ServiceContract as a REST service that can be invoked using either JSON or plain XML.
Updating the Service Reference on the Client Regenerating your WCF Data Service is the first step. The second step is to update the Service Reference in the client project. You could do that directly in Solution Explorer. Right click the generated service reference and select Update Service Reference.
When I follow different online instructions on "making my WCF RESTful", do I also lose the ability to "Add Service Reference" to those WCF services? Can WCF based REST services be added this way?
Kind of. You can add a REST MEX endpoint, but I don't think you can use that to generate a service proxy. Though, I think a better question might be, why would you want to? Web API is the best way to go for REST.
If I use Web API 2, can I "Add Service Reference"?
No. Web API doesn't have any type of metadata functionality like WCF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With