我正在使用WCF服务创建一个双层应用程序 [英] i am creating a two layer application using WCF services
本文介绍了我正在使用WCF服务创建一个双层应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个双层应用程序,一层是mvcweb,第二层是wcf服务我正在调用web层来服务它显示错误404未找到下面是我的代码请帮助我。
ajax代码:
I am creating a two layer application one layer is mvcweb and second layer is wcf services i am calling web layer to services its show me error 404 Not found below is my code please help me.
ajax code:
$(function () {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'Employee.svc/GetEmployeeList',
success: function (data) {
$($.parseJSON(data.d)).each(function (index, value) {
$("#TableID").append("<tr><td>" + value. + "</td><td>" + value.LastName + "</td><td>" + value.Email + "</td></tr>");
});
},
error: function (result) {
alert(result);
}
});
});
这是我的服务功能
here is my services function
public List<Employe> GetEmployeeList()
{
var listEmployee = new TestEntities().Employes.ToList();
return listEmployee;
}
推荐答案
( function (){
.ajax({
type: POST ,
contentType: application / json; charset = utf-8,
url:' Employee.svc / GetEmployeeList',
成功: function (data){
.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: 'Employee.svc/GetEmployeeList', success: function (data) {
(
这篇关于我正在使用WCF服务创建一个双层应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文