Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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:46 AM
Registered User
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default ServicedComponent Proxies - Please HELP


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:

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;


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.



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 - HELP pwittig .NET Web Services 0 September 21st, 2006 06:45 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.