简体   繁体   English

webHttp Vs enableWebScript,应该用于WCF REST POST请求吗?

[英]webHttp Vs enableWebScript, which should be used for WCF REST POST request?

What is the difference between webHttp and enableWebScript in WCF? WCF中的webHttp和enableWebScript有什么区别? Which should I use for a WCF REST POST request? 我应该将哪个用于WCF REST POST请求?

To make your WCF service RESTful, you will have to use WebHttp along with WebHttpBinding 要使您的WCF服务RESTful,您必须使用WebHttp和WebHttpBinding

To access your service from AJAX pages, you will have to use enableWebScript . 要从AJAX页面访问您的服务,您必须使用enableWebScript This is similar to adding [ScriptService] attribute in asmx services. 这类似于在asmx服务中添加[ScriptService]属性。

So if the service has to be restful, but you donot want to access it from AJAX, you dont have to include enableWebScript. 因此,如果服务必须是宁静的,但您不想从AJAX访问它,则不必包含enableWebScript。

http://msdn.microsoft.com/en-us/library/bb924425.aspx http://msdn.microsoft.com/en-us/library/bb924425.aspx

http://msdn.microsoft.com/en-us/library/bb675191.aspx http://msdn.microsoft.com/en-us/library/bb675191.aspx

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

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