首页 新闻 赞助 找找看

wcf和web service对entity framework对象json化不同

0
[已关闭问题]

entity framework:

class T_Logink_WLDM

 

web service:

[WebMethod]
public T_Logink_WLDM SearchWLDM( string wldm )
{
  return WLDMLoginkServer.GetWLDMInfoRemote( wldm );
}

 

wcf:

[OperationContract]
[WebInvoke( Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json )]
T_Logink_WLDM SearchWLDM( string wldm );

 

public T_Logink_WLDM SearchWLDM( string wldm )
{
  return WLDMLoginkServer.GetWLDMInfoRemote( wldm );
}

 

html:

用jquery的ajax调用服务

 

问题:

为什么用 web service 会有json返回,用wcf没有任何东西返回?

上网查了下,wcf好像不能够序列化entity framework生成的对象,但是为什么web service可以呢?

web service 将EF对象json化和wcf将EF对象json化是不同的吗?wcf中能不能采用web service的方式把EF对象json呢?

沈啣结的主页 沈啣结 | 初学一级 | 园豆:0
提问于:2010-06-03 13:59
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册