webHttp VS enableWebScript,应使用WCF REST POST请求? [英] webHttp Vs enableWebScript, which should be used for WCF REST POST request?

查看:461
本文介绍了webHttp VS enableWebScript,应使用WCF REST POST请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WCF webHttp和enableWebScript之间的区别是什么?我应该使用一个WCF REST POST请求?

What is the difference between webHttp and enableWebScript in WCF? Which should I use for a WCF REST POST request?

推荐答案

为了让您的WCF服务的RESTful,你将不得不使用 WebHttp一起的WebHttpBinding

To make your WCF service RESTful, you will have to use WebHttp along with WebHttpBinding

要访问AJAX页面为您服务,您将不得不使用enableWebScript 。这是类似于添加[ScriptService]属性中的asmx服务

To access your service from AJAX pages, you will have to use enableWebScript. This is similar to adding [ScriptService] attribute in asmx services.

因此​​,如果服务必须是宁静的,但是你DONOT想从AJAX访问它,你不必包括enableWebScript。

So if the service has to be restful, but you donot want to access it from AJAX, you dont have to include enableWebScript.

<一个href="http://msdn.microsoft.com/en-us/library/bb924425.aspx">http://msdn.microsoft.com/en-us/library/bb924425.aspx

<一个href="http://msdn.microsoft.com/en-us/library/bb675191.aspx">http://msdn.microsoft.com/en-us/library/bb675191.aspx

这篇关于webHttp VS enableWebScript,应使用WCF REST POST请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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