我通过调用网络服务获取页面包助手列表。我已经添加了网络引用。
using org.xerox.xde3.na.sdi.amiller_v_vista;
public org.xerox.xde3.na.sdi.amiller_v_vista.DDCControl proxy;
在页面加载方法中,我调用 Web 方法如下
proxy = new DDCControl();
Guid y = new Guid("45a5b1c2-2fa5-4136-abdd-bc213b694848");
DataList1.DataSource = proxy.GetAllDDCs(this.AccountID, y);
DataList1.DataBind();
我收到以下错误:
An invalid data source is being used for DataList1. A valid data source must implement either IListSource or IEnumerable
public DDCReturnGetAll GetAllDDCs(Guid accountId, Guid authToken);
GetAllDDCs的返回类型是DDCReturnGetAll
哪里
public class DDCReturnGetAll : DDCReturnBase
{ public DDCReturnGetAll();
public DDCInfo2[] DDCs { get; set; } }
哪里
DDCInfo2 是
public class DDCInfo2 { public DDCInfo2();
public BrandingType brandingType { get; set; }
public string ChargebackName { get; set; }
public string CollectorName { get; set; }
public string Description { get; set; }
public string URL { get; set; } }
您能帮我解决这个问题吗?
最佳答案
从 GetAllDDCs 返回的对象未实现 IListSource 或 IEnumerable。返回的对象很可能有一个您应该绑定(bind)到的属性。
关于c# - 调用网络服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2538546/