I have a windows application that has 2 classes
Class A - Thing inherit from Businessbase
Class B- Things inherit from BusinessListBase
I want to call a web method that passes Class B to the the web method and return Class B to the windows program. It is marked as Serialize() but the proxy is unable to generate the class
Is it possible to pass inherited objects from BusinessListBase to a web methods. any insights will be appreciated.
thanks
idriss
no When I create a Web reference in my program and look at the reference.cs, I see it created the thing class but not the THINGS class that was inerithed from BusinessListBase.
so when I run my program, i get an error at point that about InvalidOperation.
thanks
pretty much, yes. here is the code for the webmethod. AreaProjects is Class B
[WebMethod(CacheDuration = 0, MessageName = "UpdateAreaProject", EnableSession = true)]
public StatusData UpdateAreaProject(AreaProjects areaProjects)
{
//AreaProjects areaProjects = new AreaProjects();
StatusData status = new StatusData(); try{
status = areaProjects.Data_Update();
}
catch (Exception ex){
status.StatusID = (
int)StatusData.StatusTypeEnum.Error;status.TechnicalDescription += ex.ToString() +
"\r\n";}
return status;}
Tim
thanks for your help. It is not working. For some reason, when the proxy is created it just can not serialize any class derived from BusinessListBase<T,C>. It has no problem serializing classes deriving from BusinessBase<T>
I am at a loss.
Thanks
idriss
From: cslanet@lhotka.net
To: idrissbennis@hotmail.com
Date: Tue, 6 Jun 2006 17:27:13 -0500
Subject: Re: [CSLA .NET] passing a class that inherits from BusinessListBase to a web service method
Have you looked at Chapter 11? It specifically covers how to create a web service that returns data based on a business object.
Hi, I have purchased the book and read Chapter 11. It does not cover my issue. May be you can shed some light on it. I have also reviewed the source code that comes with the book. I have no problem passing to the web service and sending from the web service any class derived from BusinessBase. Classes deriving from BusinessBase contain on item so passing or receiving one item works fine.
From: Idriss Bennis [mailto:cslanet@lhotka.net]
Sent: Sunday, June 11, 2006 3:58 PM
To: rocky@lhotka.net
Subject: RE: Re: [CSLA .NET] passing a class that inherits fromBusinessListBase to a web service method
so for example
public class Project : BusinessBase<Project> contains information for one project
public class Projects : BusinessListBase<Projects, Project>, ISerializable
What I want to do is pass a the Projects class that derives from businessListBase which holds a list of projects. That class can not be serialized for some reason. is it because it supports IBindingList. It looks like it creates a Projects[] array in the proxy document but I can't seem to be able to add anything to it.
If you can shed some light, much apprieciated.
Idriss
From: cslanet@lhotka.net
To: idrissbennis@hotmail.com
Date: Tue, 6 Jun 2006 17:27:13 -0500
Subject: Re: [CSLA .NET] passing a class that inherits from BusinessListBase to a web service method
Have you looked at Chapter 11? It specifically covers how to create a web service that returns data based on a business object.
Express yourself instantly with MSN Messenger! MSN Messenger
Copyright (c) Marimer LLC