473,480 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Create 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',which 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.Collections;

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(remTmp);
}

public void Clear() {marEmails.Clear();}
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 954

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

Similar topics

1
2041
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...
5
4956
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...
2
1619
by: Asim Qazi | last post by:
Hi All public class MyResponse { public bool m_bStatus; public string m_szErrorCode; public string m_szMessage; }
15
13471
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 ...
5
8607
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
7059
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5362
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,...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4499
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...
0
3011
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...
0
3003
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
203
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...

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.