是否有创建 REST WCF Web 服务的内置功能?
我创建了一个非常简单的 WCF Web 服务,出于测试目的,它将两个数字相加并返回结果。
这一切都可以通过控制台应用程序正常运行,并引用我的域上托管的服务。
我通过以下方式创建了该服务 据
New Project -> WCF Web Service Application
我所知,默认情况下这是一个 SOAP Web 服务,对吗?
我想知道 REST Web 服务是 WCF 的内置 Web 服务类型,还是涉及解决方法?
我希望能够通过点击 URL 并获取结果来调用 Web 服务,因为我知道这需要服务是 REST 服务而不是 SOAP。
I have created a WCF web service that is very simple, for testing purposes it adds two numbers together and returns the result.
This all works fine from a console app with a reference to the service hosting on my domain.
I created the service by going to
New Project -> WCF Web Service Application
As I understand, by default this is a SOAP web service, correct??
I am wondering are REST Web Services a built in type of Web Service for WCF, or does it involve work arounds?
I want to be able to call the Web Service by hitting a URL and getting the result back, as I understand this requires the service to be a REST service rather than SOAP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,默认情况下将使用基于肥皂的 basicHttpBinding。您将需要查看 webHttpBinding 以使您的服务更加轻松。您可以在 http://msdn.microsoft.com/en- 找到简短指南我们/library/bb412178.aspx。
Yes, by default the basicHttpBinding will be used which is soap based. You will want to look at the webHttpBinding to make your service restful. You can find a short guide at http://msdn.microsoft.com/en-us/library/bb412178.aspx.