Elaine
Elaine

Reputation: 1318

Is it possible to generate web reference classes for REST serivce?

This sounds a strange question. I'm currently working on migrate a heavy wcf application to .net core, which means, I need to migrate the web reference classes, wcf behavior extensions to .net core WebAPI/mvc. And I have to migrate another project consuming the heavy wcf and using its proxy classes to .net core also, not just to call the REST service, but to add service reference and use the classes.

Is it possible to generate web reference classes for REST serivce? (I wonder why I cannot find any articles about the wcf migration to .net core.)

Upvotes: 1

Views: 51

Answers (1)

tom redfern
tom redfern

Reputation: 31780

No, it's not possible. Web references are wrappers which can only be generated for services exposing SOAP operations that contain a public WSDL metadata endpoint.

If you're consuming a service operation exposed over HTTP using REST principals, there is no metadata for a consumer to use to generate the reference, unless you use something like OpenAPI which WCF does not yet have any built-in support for.

Your consumers need to be provided with the actual resources which your service exposes, their URIs, and which HTTP operations are valid for those resources.

Then they can call a service operation using something like HttpClient.

Upvotes: 1

Related Questions