如何将现有WCF服务公开为REST [英] How to expose the existing WCF service as REST

查看:105
本文介绍了如何将现有WCF服务公开为REST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我希望公开托管的现有WCF服务。现在我希望将此服务公开为REST



任何人都可以帮忙解决这个问题。



Thnx

dismak

Hi,

I want expose existing WCF service which is hosted. now i want expose this service as REST

can anybody help on this how to do.

Thnx
dismak

推荐答案

你不能直接这样做。实际上,他们背后有不同的概念。 wcf是面向服务的(就像方法调用一样)。但是,restful服务是面向对象的(改变对象的状态)。在转换之前,您必须找出您的服务将具有哪些对象,然后使用http方法(get,put等)指定如何更改其状态。

这里是宁静服务设计的msdn条目[ ^ ]。
you cannot do this directly. actually, they have different concepts behind. wcf is service-oriented (like method calls). but, restful service is object-oriented (changing state of objects). before converting it, you have to find out what objects your service will have, then specify how to change their states by using http methods (get, put, etc).
here is msdn entry for restful service design[^].


这篇关于如何将现有WCF服务公开为REST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆