【发布时间】:2017-04-21 06:56:42
【问题描述】:
这是我创建的 Struct 类
public struct Biller
{
public string BillerTag { get; set; }
public string Description { get; set; }
public string FirstField { get; set; }
public string FirstFieldFormat { get; set; }
public string FirstFieldWidth { get; set; }
public string SecondField { get; set; }
public string SecondFieldFormat { get; set; }
public string SecondFieldWidth { get; set; }
public string ServiceCharge { get; set; }
}
我正在尝试使用此代码,但它只显示 1 并且只显示最后一个输出
[WebMethod(Description = "Retrieves list of available BILLERS for collection as well as other information necessary for the transaction")]
public Biller GetBillerList(string AccountID, string UserName, string Password)
{
ECPNBills.ECPNBillsPaymentService Client = new ECPNBills.ECPNBillsPaymentService();
ECPNBills.BStruct Str = new ECPNBills.BStruct();
Biller Bil = new Biller();
Str = Client.GetBillerList(AccountID, UserName, Password);
foreach (ECPNBills.BStruct cd in Client.GetBillerList(AccountID, UserName, Password))
{
Bil.BillerTag = cd.BillerTag;
Bil.Description = cd.Description;
Bil.FirstField = cd.FirstField;
Bil.FirstFieldFormat = cd.FirstFieldFormat;
Bil.FirstFieldWidth = cd.FirstFieldWidth;
Bil.SecondField = cd.SecondField;
Bil.SecondFieldFormat = cd.SecondFieldFormat;
Bil.SecondFieldWidth = cd.SecondFieldWidth;
Bil.ServiceCharge = cd.ServiceCharge;
}
return Bil;
}
我不确定要使用什么代码从 BStruct 中获取所有项目。
我也在尝试使用 webservice 到 webservice。先谢谢啦~
【问题讨论】:
标签: c# asp.net web-services soap