我在 Web 服务中有以下类:
[Serializable]
public class WebServiceParam
{
public string[] param;
}
在客户端应用程序中:
string[] reportFields = new string[] { "invoiceNo", "sale", "item", "size", "missingQty", "Country", "auto" };
param.ReportFields = reportFields;
serviceInstance.CreateReport(param);
但是,字符串数组成员为“null”
这是我的网络服务类:
[WebService(Description = "Service related to producing various report formats", Namespace = "http://www.apacsale.com/ReportingService")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class ReportingService : System.Web.Services.WebService
{
ReportingServiceImpl m_reporting;
[WebMethod]
public string CreateReport(ReportingParameters param)
{
if (param != null)
{
m_reporting = new ReportingServiceImpl(param);
m_reporting.Create();
return m_reporting.ReturnReport();
}
return null;
}
}