I have a current requirement to all a subsidiary to use a current legacy
application and interface with my new system to inject data when appropriate.
I wanted to create a web service since we are both .Net shops and this would
seem to be the easiest method. But I ran into one snafu. I wanted to return
to the subsidiary an ArrayList of my Organization objects which contain the
orgs id, name etc. so they can use that information in the data insert call.
I have done a lot of looking around but have not found the answer yet to
accomplish this. Here is some of the code:
1. Web service calls an object manager which returns the ArrayList:
1. ArrayList _array = ObjectManager.I nstance.GetAllO rgs();
2. Object manager calls the object data store returning ArrayList
1. ObjectStore.Ins tance.GetAllOrg s();
3. Object store makes database call, passes reader to method that loops
over results building an Org object and adding it to an array.:
1. public ArrayList GetAllOrgs()
{
ArrayList orgs = new ArrayList();
using (SqlConnection connection = new
SqlConnection(_ connectionStrin g))
{
connection.Open ();
SqlCommand command = new SqlCommand();
command.Connect ion = connection;
command.Command Type = CommandType.Sto redProcedure;
command.Command Text = "usp_GetOrg s";
SqlDataReader reader =
command.Execute Reader(CommandB ehavior.SingleR esult);
orgs = CreateOrgs(read er);
}
return orgs;
}
That is my issue in a nutshell - my web page that consumes the web service
does not know how to cope with the ArrayList with Org objects in it.
Any help would be much appreciated!
SharePoint Tips and Tricks
http://drewmace.blogspot.com