我从dojo调用我的wcf服务并且无法加载错误500.当我在visual studio中使用WCF测试客户端测试服务时它工作正常。我正在使用dojo xhr get来调用WCF服务:
模块呼叫服务:
define(['dojo/store/Memory', 'dojo/_base/xhr', "dojo/data/ObjectStore"],
function (Memory, xhr, ObjectStore) {
return {
GetReaches: function (url) { //url is: "http://localhost:54052/FormTest/proxy.ashx?http://localhost:57735/Service1.svc/GetReaches/"
xhr.get({//get data from database
url: url,
handleAs: "json",
load: function (result) {
ReachData = result.GetReachesResult;
},
error: function (err) { }//500 error caught
});
} //GetReaches
}
});
我没有将任何参数传递给服务,因此它不能传递给函数的错误数据类型。还有什么想法可能是什么问题?
由于
皮特
答案 0 :(得分:0)
最后让它工作,我把这个重要的项目从web.config文件中删除了:
<services>
<service name="SARIService.Service1" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="SARIService.IService1" behaviorConfiguration="web">
</endpoint>
</service>
</services>