当我试图Sytem.Array
在 Json Class 对象中获取 As 数据成员时,它会给出失败响应。
我的 WCf Web 服务我正在使用以下userActivities
返回类的方法。我在AjaxActivity
的类中设置了参数。Activity
[ServiceContract]
public interface IMyService
{
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
Activity userActivities(Activity activity, string action);
}
[DataContract]
partial class Activity
{
}
在 MyService.cs 服务类中是
public Activity userActivities(Activity activity, string action)
{
if (action.ToLower() == "myactivities")
{
activity.get_MyActivities();
}
return activity;
}
课堂活动是:
[DataMember]
public int userID;
[DataMember]
public Array _getList_MyActivities;
public void get_MyActivities()
{
_DL_Activity = new DL_Activity();
if (this.userID > 0)
this._getList_MyActivities = _DL_Activity.get_MyActivity(this.userID);
}