c# - 调用网络服务时出错

标签 c# web-services asmx

我通过调用网络服务获取页面包助手列表。我已经添加了网络引用。

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/

相关文章:

java - 在android代码中没有得到web服务的响应

json - 如何将 jqGrid 与 asmx webservice C# 绑定(bind)

c# - ASMX Web 服务未序列化抽象基类

c# - SQL Server 中的 varbinary 类型如何在 C# 中的函数中使用

c# - 如何判断控件是否有Text属性

c# - 如何在带参数的 MVC4 中使用 Url.Content()?

c# - 网页上的嵌套 foreach 循环

php - 从 Java 到 PHP 重新创建 PDF 文件

java - 从 Web 服务响应中删除自定义标签

asp.net - 带有 Guid 参数的 ASMX Web 服务