ServicedComponent proxies - HELP
Hi,
I am having a great deal of trouble trying to return an object from my
ServicedComponent. The application is SOAP enabled and I have created a proxy class using the wsdl.exe tool, but it keeps giving me problems.
Here are my two ServicedComponent classes:
[EventTrackingEnabled]
public class BasicSC: ServicedComponent
{
public BasicSC() { }
public String HelloSC()
{
return "Hello COM+ World";
}
public ReturnObject GetObj(int i, string a)
{
ReturnObject ro = new ReturnObject();
ro.id = i;
ro.descrip = a;
return ro;
}
}
[Serializable]
public class ReturnObject : ServicedComponent
{
public int id;
public string descrip;
public ReturnObject() { }
}
My client then runs the following code:
BasicSCService bsc = new BasicSCService();
ReturnObject ro = new ReturnObject();
ro = bsc.GetObj(1, "test");
If the ServicedComponent App is a server application I get this error:
InvalidCastException was caught
Unable to cast object of type 'System.Xml.XmlNode[]' to type 'ReturnObject'.
My question is, is the wsdl.exe the correct tool for generating a proxy? Should I be using WKO or CAO instead? Is there another alternative?
If it is the correct tool, what is wrong with my code?
Any info would be greatly appreciated. I've been stuck on this for quite a while.
Thanks,
Pete
|