Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I generate a service reference automatically for a REST WCF service?

Tags:

json

rest

c#

soap

wcf

The ONLY argument I can see for SOAP WCF over REST (json) wcf is the fact that once my service is created I can add a a reference in visual studio and I get a load of strongly typed classes ready for me and a client class that I can call all my webmethod through. It even sets up the web.config as far as I remember.

However when I expose a REST (json) service I still get a WSDL. So Im wondering is there still a way to build my references automatically?

like image 297
Exitos Avatar asked Apr 19 '12 16:04

Exitos


1 Answers

Not using WCF tools. Unlike with SOAP (which has an established protocol for describing services - WSDL), REST doesn't. WADL is one such protocol, but it isn't too widespread and WCF does not support it. You still get a WSDL, because WCF will describe everything it can from the service. However, the WSDL won't have a <wsdl:port> element, which would describe the REST endpoint, which is why you get the WSDL, but cannot generate a reference to it.

The post at http://blogs.msdn.com/b/carlosfigueira/archive/2012/03/26/mixing-add-service-reference-and-wcf-web-http-a-k-a-rest-endpoint-does-not-work.aspx has a lot more info on this issue.

like image 145
carlosfigueira Avatar answered Oct 05 '22 12:10

carlosfigueira