默认情况下,WCF 服务是基于 Restful 的还是基于 Soap 的?
我是 WCF 新手,刚刚做了一个示例服务。如果我们没有在任何地方指定,请指导我默认WCF服务是soap还是restful?我尝试运行我的服务的 URL 并得到此页面。我感觉它是基于 SOAP 的。请指导。
谢谢
I am new to WCF and just have made a sample service. Please guide me by default WCF services are soap or restful if we not specify anywhere ? I tried to run URL of my services and got this page. I am feeling it is SOAP based. Kindly guide.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,WCF 服务是 SOAP - 除非您使用 REST 形式的
webHttpBinding
(目前这是唯一的 RESTful 绑定)。要测试基于 SOAP 的服务,您不能仅导航到浏览器中的 URL - 您需要使用 SOAP 测试应用程序,例如 SoapUI 或WCF 测试客户端。WCF 数据服务 和WCF RIA 服务 基于
webHttpBinding
,因此是基于REST 的。只需浏览 URL 即可测试 REST 服务 - 您将得到可在浏览器中显示的 XML(或可存储到文件并查看的 JSON)WCF services by default are SOAP - unless you use the
webHttpBinding
which is REST (and this for now is the only RESTful binding). To test your SOAP based services, you cannot just navigate to an URL in your browser - you need to use a SOAP test app, like SoapUI or the WCF Test Client.WCF Data Services and WCF RIA Services are based on
webHttpBinding
and thus are REST-based. REST services can be tested by just browsing to the URL - you'll get back XML that can be shown in your browser (or JSON which you can store to a file and look at)默认情况下,如果您在 Visual Studio 中使用项目项“WCF 服务”,则 WCF 服务是基于 Soap 的。
By default, WCF services are soap based if you use the project item "WCF Service" in visual studio.