P
Peter
I have a WebService which returns a List of RunningReport class
How do I read this XML data on the client side. How do I convert
List<RunningReport> from the WebService side to List<RunningReport> on the
client side
I have tried the following:
List<RunningReport> reportList = null;
localhost.ReportService localrs = new localhost.ReportService();
localrs.Url = GetServiceURL();
reportList = localrs.RunningReports();
but I am getting the following error
Error 67 Cannot implicitly convert type 'localhost.RunningReport[]' to
'System.Collections.Generic.List<Reports.Modules.RunningJobs.RunningReport>
Thank You
Peter
//////////////// Heres' the XML data from the WebService
///////////////////////////////////
<?xml version="1.0" encoding="utf-8" ?>
ArrayOfRunningReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://wsinc.com/webservices/">
<RunningReport>
<ReportID>0</ReportID>
<CreatedBy>12</CreatedBy>
<ItemId>1</ItemId>
<OutputType>PDF</OutputType>
</RunningReport>
<RunningReport>
<ReportID>0</ReportID>
<CreatedBy>12</CreatedBy>
<ItemId>2</ItemId>
<OutputType>PDF</OutputType>
</RunningReport>
</ArrayOfRunningReport>
///////////////////////////////////// Here's the class that the Webservice
is returning: ////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ReportInfoLib
{
[Serializable]
public class RunningReport
{
private string _reportName;
private int _reportID;
private int _createdBy;
private string _discription;
private int _itemId;
private DocumentTypeEnum _outputType;
private string _printerName;
private string _trayName;
private string _emailList;
private List<ParameterNameValue> _pnv;
public string ReportName
{
get { return this._reportName; }
set { this._reportName = value; }
}
public int ReportID
{
get { return this._reportID; }
set { this._reportID = value; }
}
public int CreatedBy
{
get { return this._createdBy; }
set { this._createdBy = value; }
}
public string Discription
{
get { return this._discription; }
set { this._discription = value; }
}
public int ItemId
{
get { return this._itemId; }
set { this._itemId = value; }
}
public ReportInfoLib.DocumentTypeEnum OutputType
{
get { return this._outputType; }
set { this._outputType = value; }
}
public string PrinterName
{
get { return this._printerName; }
set { this._printerName = value; }
}
public string TrayName
{
get { return this._trayName; }
set { this._trayName = value; }
}
public string EmailList
{
get { return this._emailList; }
set { this._emailList = value; }
}
public
System.Collections.Generic.List<ReportInfoLib.ParameterNameValue> Pnv
{
get { return this._pnv; }
set { this._pnv = value; }
}
}
}
How do I read this XML data on the client side. How do I convert
List<RunningReport> from the WebService side to List<RunningReport> on the
client side
I have tried the following:
List<RunningReport> reportList = null;
localhost.ReportService localrs = new localhost.ReportService();
localrs.Url = GetServiceURL();
reportList = localrs.RunningReports();
but I am getting the following error
Error 67 Cannot implicitly convert type 'localhost.RunningReport[]' to
'System.Collections.Generic.List<Reports.Modules.RunningJobs.RunningReport>
Thank You
Peter
//////////////// Heres' the XML data from the WebService
///////////////////////////////////
<?xml version="1.0" encoding="utf-8" ?>
ArrayOfRunningReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://wsinc.com/webservices/">
<RunningReport>
<ReportID>0</ReportID>
<CreatedBy>12</CreatedBy>
<ItemId>1</ItemId>
<OutputType>PDF</OutputType>
</RunningReport>
<RunningReport>
<ReportID>0</ReportID>
<CreatedBy>12</CreatedBy>
<ItemId>2</ItemId>
<OutputType>PDF</OutputType>
</RunningReport>
</ArrayOfRunningReport>
///////////////////////////////////// Here's the class that the Webservice
is returning: ////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ReportInfoLib
{
[Serializable]
public class RunningReport
{
private string _reportName;
private int _reportID;
private int _createdBy;
private string _discription;
private int _itemId;
private DocumentTypeEnum _outputType;
private string _printerName;
private string _trayName;
private string _emailList;
private List<ParameterNameValue> _pnv;
public string ReportName
{
get { return this._reportName; }
set { this._reportName = value; }
}
public int ReportID
{
get { return this._reportID; }
set { this._reportID = value; }
}
public int CreatedBy
{
get { return this._createdBy; }
set { this._createdBy = value; }
}
public string Discription
{
get { return this._discription; }
set { this._discription = value; }
}
public int ItemId
{
get { return this._itemId; }
set { this._itemId = value; }
}
public ReportInfoLib.DocumentTypeEnum OutputType
{
get { return this._outputType; }
set { this._outputType = value; }
}
public string PrinterName
{
get { return this._printerName; }
set { this._printerName = value; }
}
public string TrayName
{
get { return this._trayName; }
set { this._trayName = value; }
}
public string EmailList
{
get { return this._emailList; }
set { this._emailList = value; }
}
public
System.Collections.Generic.List<ReportInfoLib.ParameterNameValue> Pnv
{
get { return this._pnv; }
set { this._pnv = value; }
}
}
}