2010-03-29 75 views
2

我通过调用webservice获取pagepack助手的列表。我已经添加了Web引用。调用webservice时出错

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; } } 

能否请你帮我这个问题?

+1

GetAllDDCs返回的类型是什么?在对象浏览器窗口中查看它在客户端上返回的内容。同时告诉我们它在服务器上返回的结果。 – 2010-03-29 14:21:42

+0

你可以显示一部分DDCControl的代码吗? – 2010-03-29 14:22:01

+0

GetAllDDC的返回类型为DDCReturnGetAll,其中 公共类DDCReturnGetAll:DDCReturnBase { public DDCReturnGetAll(); public DDCInfo2 [] DDCs {get;组; } } 其中DDCInfo2是 public class DDCInfo2 public DDCInfo2(); public BrandingType brandingType {get;组; } public string ChargebackName {get;组; } public string CollectorName {get;组; } public string描述{get;组; } public string URL {get;组; }} – xrx215 2010-04-02 14:41:39

回答

1

您将需要查看procy.GetAllDDC方法的返回类型,并查看它返回的内容。

您收到的错误消息显示DataList1控件找不到枚举绑定项的方法。

2

从GetAllDDC返回的对象不实现IListSource或IEnumerable。最有可能的是,返回的对象具有您应该绑定到的属性。