简体   繁体   English

ASP.Net MVC4 WebApi代理

[英]ASP.Net MVC4 WebApi proxy

I am starting to play with WebApi and Rest services. 我开始玩WebApi和Rest服务。 Till now I was always developing SOAP APIs. 直到现在我一直在开发SOAP API。

My Question is there something parallel to proxy in MVC4 WebApi or it's only SOAP world concept. 我的问题是在MVC4 WebApi中存在与代理并行的东西,或者它只是SOAP世界概念。 If not how the clients know the full description of the Web functions that I expose to them. 如果不是客户端如何知道我向他们公开的Web功能的完整描述。

Thanks 谢谢

I suppose you mean the WSDL service description, which does not exist in WebAPI as such. 我想你的意思是WSDL服务描述,它在WebAPI中不存在。 Now I see you also added the tag REST to the question and I would like to stress that the WebAPI does not enforce REST practices. 现在我看到你还在问题中添加了标签REST,我想强调一下,WebAPI并不强制执行REST实践。

REST is in the middle of some discussion lately, but I would think everyone agrees it does not define any wsdl-like service. REST最近正在进行一些讨论,但我认为每个人都认为它没有定义任何类似wsdl的服务。

It does however require you to make your documents self-describing and encourages publishing possible state transfers and links to related documents more info here: http://en.wikipedia.org/wiki/HATEOAS 但是,它确实要求您使您的文档自我描述并鼓励发布可能的状态转移和相关文档的链接更多信息: http//en.wikipedia.org/wiki/HATEOAS

REST is a very different beast than SOAP because it actually does not want you to send commands to and from the server other than the basic ones needed to get/update/.. resources, but a full description of this is beyond the scope of this post :-) REST是一种与SOAP完全不同的野兽,因为它实际上不希望您向服务器发送命令而不是从获取/更新/ ...资源所需的基本命令之外发送命令,但是对此的完整描述超出了此范围。发布:-)

That being said, the webAPI technology in itself does not have any reservations in that regard and it would be perfectly possible to put full-blown services and a related wsdl like structure in place. 话虽如此,webAPI技术本身在这方面没有任何保留,完全可以将全面的服务和相关的类似wsdl的结构放在适当的位置。

I can recommend this project, I have used it for several projects, and it works well. 我可以推荐这个项目,我已经将它用于几个项目,并且运行良好。

PS: I am a collaborator on the project, although I havent committed any code yet. PS:我是该项目的合作者,虽然我还没有提交任何代码。

https://github.com/RestCode/WebApiProxy https://github.com/RestCode/WebApiProxy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM