PC Review


Reply
Thread Tools Rate Thread

Base class members are not exposed in Excel using Web Service

 
 
=?Utf-8?B?WW9K?=
Guest
Posts: n/a
 
      29th Jan 2007
Hi,

I am trying to reference a web service from Excel using Office 2003 Web
Service Toolkit and I have the following objects defined:

[Serializable()]
public class BaseClass
{
private int id;

public int ID
{
get { return id; }
set { id = value; }
}
}

[Serializable()]
public class InheritedClass : BaseClass
{
private int attribute;

public int Attribute
{
get { return attribute; }
set { attribute = value; }
}
}

and I have the following method defined in the web service:

[WebMethod( Description = "description", MessageName = "GetAttribute" )]
[XmlInclude( typeof( BaseClass ) )]
public string GetAttribute( InheritedClass test )
{
return test.Attribute;
}

When my web service is referenced in the Excel, it generates a structure
called "struct_InheritedClass" with "Attribute" property but it does not
contain base class property "ID".

How can I expose members of base class in the structure of inherited class?
Shouldn't the Web Service Toolkit also generate a structure for base class
as well?

Any help would be appreciated.
Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hidden members of a base class beginwithl@gmail.com Microsoft C# .NET 4 8th Jan 2009 08:18 AM
How to access private members of a base class =?Utf-8?B?QWJlbGFyZG8gVmFjY2E=?= Microsoft C# .NET 10 24th Oct 2005 07:46 PM
Inheriting Base Class members =?Utf-8?B?c291cmNl?= Microsoft Dot NET 0 18th Apr 2005 10:39 PM
qualify base class members from derived class StephenRichter@gmail.com Microsoft C# .NET 5 12th Apr 2005 01:25 PM
How can I hide base class members that are public C-Sharper or C-Hasher, one of the two Microsoft C# .NET 4 24th Feb 2004 11:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:09 AM.