Hi,
I'm using Visual Studio 2005.
Need to expose a report via a SOAP interface, know its a bad idea not my decision. Created a Web Services and a Class representing the required fields. When I run and select a single instance of the selected rows the Service correctly returns the full XML. When I define an array of desired class and populate the array with rows the interface do not return the entire XML, it only appears to return the header or port of the header.
See excerpts below
CODE
public class activity
{
private string datum;
private string time;
private string txnType;
private string voidFlag;
........
public string Datum
{ get { return datum; } set { datum = value; }
}
public string Time
{ get { return time; } set { time = value; }
}
public string TxnType
{ get { return txnType; } set { txnType = value; }
}
............
public activity()
{
//
// TODO: Add constructor logic here
//
}
}
snippets from web service
CODE
int i = 0;
activity[] row =new activity[100];
ConnectionStringSettings cs =
ConfigurationManager.ConnectionStrings["OpticardConnectionString"];
string connString = cs.ConnectionString;
using (OdbcConnection connection = new OdbcConnection(connString))
{
OdbcCommand command = new OdbcCommand(SQL, connection);
connection.Open();
// Execute the DataReader and access the data.
OdbcDataReader reader = command.ExecuteReader();
int numRows = reader.RecordsAffected;
while (reader.Read())
{
row[i] = new activity();
row[i].Datum = reader.IsDBNull(1) ? "" : reader.GetString(1);// (string)reader[1]; // trans_date
row[i].Time = reader.IsDBNull(2) ? "" : reader.GetString(2); //(string)reader[2]; // trans_time
//activity.TxnType = (int)reader[3];
..............
}
reader.Close();
}
return row[i];
This does not return complete xml! however if I only use a single instance of the class 'activity'
as opposed to the array, I do get a well formed complete XML response!
Any ideas suggestions will be greatly appreciated! TIA!
OKay, I found an error with my code, yikes! i is pointing past the last valid row? If I return row The compiler complains that it can not convert type activity[] to activity?
This post has been edited by jvds2001: 18 Jul, 2008 - 03:54 PM