Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
| Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2006, 06:45 AM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Private Proxies for browser in Vb.net tanweerahmad .NET Framework 2.0 0 October 27th, 2007 01:59 PM
ServicedComponent Proxies - Please HELP pwittig General .NET 0 September 21st, 2006 06:46 AM
Invalid ServicedComponent jdang67 C# 2005 0 February 10th, 2006 12:36 PM
COM+ .Net and application proxies LowestoftheLow General .NET 1 August 25th, 2004 11:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.