使用WADL而不是WSDL的.NET中的静态服务 [英] Restful service in .NET with WADL instead of WSDL

查看:162
本文介绍了使用WADL而不是WSDL的.NET中的静态服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WCF通过.svc文件在.NET中创建一个宁静的Web服务. Web应用程序将自动生成WSDL文件. AFAIK,对于轻松的Web服务而言,WADL更自然.

I used WCF to create a restful web service in .NET, by means of a .svc file. The web application automatically produces a WSDL file. AFAIK, the WADL is more natural for a restful web service.

如何在.NET(最好使用wcf)中创建一个宁静的服务来生成WADL描述?

How could I create a restful service in .NET (preferably with wcf) that produces a WADL description?

注意,只要您指出合适的手册/教程,就可以接受"RTFM"之类的答案.

Note An answer like "RTFM" is accepted, as long as you indicate a suitable manual/tutorial.

推荐答案

原谅我回答一个问题,但是您真的要进行REST吗? REST实际上不需要WADL之类的东西.

Forgive me for answering a question with a question, but do you really want to do REST? REST really has no need for things like WADL.

更新:

超媒体约束"(又名HATEOAS)指示用户代理基于嵌入在先前检索的内容中的链接来发现内容.确实没有必要使用单独的文档来描述所有可用内容.

The "hypermedia constraint" (aka HATEOAS) dictates that the user agent discovers content based on links embedded in previously retrieved content. It really is unnecessary to have a separate document that describes all the available content.

想象一下,使用Web浏览器转到站点,而不是转到主页并从那里导航,您将看到一个页面,该页面是站点上所有URL的列表.然后,您必须浏览可用的URL列表,选择感兴趣的URL,然后将其复制到地址栏中.
WADL实际上是您列出的站点URL.如果您的主要内容链接在一起,您就不需要它.

Imagine using a web browser to go to a site and instead of going to the home page and navigating from there, you are presented with a page which is a list of all the URLs on the site. You must then looks through the list of available urls, choose the one you are interested in and copy it into the address bar.
WADL is effectively you list of site urls. You just don't need it if your main content is linked together.

链接内容而不使用WADL站点地图"还有其他优点.可用链接可以基于内容中的特定数据值而动态变化.此功能可以极大地降低客户端的复杂性,因为客户端不再需要托管逻辑来决定何时允许其跟随链接.

Linking content instead of using a WADL "site map" has other advantages. The available links can be dynamic based on particular data values in the content. This capability can vastly reduce the complexity of clients, because the client no longer needs to host the logic to decide when it is allowed to follow a link.

这篇关于使用WADL而不是WSDL的.NET中的静态服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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