Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a WCF Rest C# Client Generation Tool?

Tags:

Before I venture down the path of creating one, I was wondering if anyone knows of a utility program which will take the REST Help page of a WCF Rest Service and create the relevant Client for C# consumption.

Similar to what svcutil.exe does for WCF Services or what wsdl.exe did for web services but for WCF REST Services

Kind Regards,

Andrew

EDIT Some more detail:

Please see this link: http://msdn.microsoft.com/en-us/library/dd203052.aspx

In the restful service using the WCF Rest Starter Kit Preview 2, they supply types which will be serialized. But My intention is be able to create clients form the help page which describes schemas. Clients could then be created for C#, JavaScript, ActionScript etc.. shearly as a strongly typed version of the restful service, not a requirement or necessity. It is a program or uitlity I am wondering exists which does this

like image 671
REA_ANDREW Avatar asked Mar 16 '09 17:03

REA_ANDREW


People also ask

Can WCF be REST?

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.

Is WCF and REST API are same?

WCF is used for developing SOAP-based services whereas Web API is used for both SOAP-based and RESTful services. WCF does not offer any support for MVC features whereas Web API supports MVC features. WCF supports HTTP, UDP, and custom transport protocol whereas Web API supports only HTTP protocol.

Is WCF a REST or SOAP?

Normally, a WCF service will use SOAP, but if you build a REST service, clients will be accessing your service with a different architectural style (calls, serialization like JSON, etc.).


2 Answers

I think you might be looking for the WebChannelFactory. It can generate a channel class based on a WCF-attributed REST interface.

like image 123
GuyBehindtheGuy Avatar answered Sep 25 '22 19:09

GuyBehindtheGuy


Well, there will not be any use even if you would like to abstract. ALL Rest services can use HTTP verbs like GET, POST, PUT, DELETE

So, basically what your client can have is only a static class which can accept the end point, network credentials, a name value collection which needs to be passed and the verb to use.

This would be more of a utility class rather than a client.

I don't remember seeing WSDL or some contract based on which we can write clients for the REST services.

like image 24
Ramesh Avatar answered Sep 25 '22 19:09

Ramesh