473,545 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning my object(s) from web service

Hi there

I am trying to return an instance of a class from a web service that
contains a collection of instances of another class. I have three classes:

Person
MyEmails
MyEmail

Person is the 'base' class, which may contain an instance of
'MyEmails',whic h is essentially a collection of instances of 'MyEmail.' In
the code calling the web method the instance of the 'Person' class returned
is populated correctly, except that the properties/methods of my 'MyEmails'
class cannot be accessed. I just see the generic methods (ToString, Equals
etc). Am I missing something obvious?

The code for the file containing the three classes (in simplified form)
follow - thanks in advance if anyone can help.
using System;
using System.Collecti ons;

namespace Test.WebService
{
public class Person
{
private Test.WebService .MyEmails memEmails = new
Test.WebService .MyEmails();

public Test.WebService .MyEmails Emails {get {return memEmails;}set
{memEmails = value;}}

public Person()
{
}
}

public class MyEmails
{
ArrayList marEmails = new ArrayList();

public MyEmails()
{
}

public MyEmail this[int index]
{
get
{
Test.WebService .MyEmail remTmp = marEmails[index] as
Test.WebService .MyEmail;
return remTmp;
}
}

public void Add(string Email)
{
Test.WebService .MyEmail remTmp = new Test.WebService .MyEmail(Email) ;
marEmails.Add(r emTmp);
}

public void Clear() {marEmails.Clea r();}
public int Count {get {return marEmails.Count ;}}
}

public class MyEmail
{
private string msEmail = "";

public MyEmail()
{
}

public MyEmail(string Email)
{
msEmail = Email;
}

public string Email {get {return msEmail;} set {msEmail = value;}}
}
}

Nov 17 '05 #1
0 960

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2052
by: Matthias De Ridder | last post by:
Hello, I really hope that someone will be able to help me, because I'm desperate now! I'm a student, graduating this year, and I'm working on a thesis where C# Web Services are involved. I only have three weeks to finish it all! My GUI and Web services were finished, but I hadn't tested them. So I linked the GUI to the Web service and...
5
4962
by: Jim Murphy | last post by:
In creating a C# web service, I am having trouble returning a DataTable object as the result of a web method. I have no problem returning native types like string or int, but cannot return a .NET DataTable object. The problem occurs when I try to compile the client side C# application (it complains about the DataTable type not being...
2
1625
by: Asim Qazi | last post by:
Hi All public class MyResponse { public bool m_bStatus; public string m_szErrorCode; public string m_szMessage; }
15
13486
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data...
5
8622
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
0
7434
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.