2010-03-29 89 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。最有可能的是,返回的對象具有您應該綁定到的屬性。