mr_prabhu
11-22-2006, 06:07 AM
Hi,
I am presently working on a web service implemented using Spring.NET.
I am new to Spring.NET. I have a scenario where we need to instantiate an object based on a property value provided by client applications and set it to another property.
I have an asmx file with one exposed method called execute
It accepts a serializable business object called DataInput as an input parameter.
DataInput looks similar to this
[Serializable]
public class DataInput
{
private int intID;
private objType objtype; // objType is an enumeration ObjectA =1, ObjectB =2
public int ID
{
get{return intID;}
set{intID=value;}
}
public objType ObjectType
{
get{return objtype;}
set{objtype= value;}
}
}
I have 2 classes ObjectA and ObjectB, both derived from IMyobject
Based on the value provided in the ObjectType property I need to instantiate the appropriate class ObjectA or ObjectB and assign it to a property which excepts a value of IMyObject type.
Please let me know if you have come across such a scenario and how we can go about configuring this.
Thanks,
Rajesh
I am presently working on a web service implemented using Spring.NET.
I am new to Spring.NET. I have a scenario where we need to instantiate an object based on a property value provided by client applications and set it to another property.
I have an asmx file with one exposed method called execute
It accepts a serializable business object called DataInput as an input parameter.
DataInput looks similar to this
[Serializable]
public class DataInput
{
private int intID;
private objType objtype; // objType is an enumeration ObjectA =1, ObjectB =2
public int ID
{
get{return intID;}
set{intID=value;}
}
public objType ObjectType
{
get{return objtype;}
set{objtype= value;}
}
}
I have 2 classes ObjectA and ObjectB, both derived from IMyobject
Based on the value provided in the ObjectType property I need to instantiate the appropriate class ObjectA or ObjectB and assign it to a property which excepts a value of IMyObject type.
Please let me know if you have come across such a scenario and how we can go about configuring this.
Thanks,
Rajesh