473,224 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Web Service returning types - BIG PROBLEMS


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 started testing them.

From the GUI, I called the Web service method:

[XmlInclude(typeof(Tender)), XmlInclude(typeof(Offer)),
public ArrayList GetTenders(string user, string password)

This method all tenders out of a database, and sends them back in an

The class Tender looks like this:

public class Tender
#region Private fields

private string name;
private string surname;
private string hospital;
private string tenderID;
private DateTime date;
private DateTime dateLimit;
private ArrayList productList;
private ArrayList offerList;


#region Constructors

public Tender()
this.name = "";
this.surname = "";
this.hospital = "";
this.tenderID = "";
this.productList = new ArrayList();
this.offerList = new ArrayList();

public Tender(string name, string surname, string hospital, DateTime date,
DateTime dateLimit, string tenderID)
this.name = name;
this.surname = surname;
this.hospital = hospital;
this.date = date;
this.dateLimit = dateLimit;
this.tenderID = tenderID;
this.productList = new ArrayList();
this.offerList = new ArrayList();
// Getters and setters

The problem is that I receive an array containg arrays of XmlNodes as
returning value of the Web Service method GetTenders.

I really need the help from someone to solve this problem, and be able to
get the tender information back from the web service instead of the XmlNodes.

I've read several related questions in this discussion group, but none of
them helped me! I hope someone can help me!

Nov 23 '05 #1
1 2025
What you should be doing is not returning an ArrayList but you should
be returning Tender[] or whatever object you need. This assumes that
you are consuming your web service via a Web Reference. If not please
follow the instructions provided at the bottom.
Any object that needs to be used on both the web service and client
that is an ArrayList should not be an arraylist but should be the
strongly typed object and should be exposed as a property. This causes
the increased headache of adding the items to the arraylist and then at
the last minute creating an ArrayOfObject[] that is the appropraite
size and then copying the Items over. This will however ensure that the
client can get the objects easily and effortlessly.

Hope this helps
What your client project needs to do is to add a Web Reference.
In your client project go to Project -> Add Web Reference. Type in the
URL that your Web Service is located at.

There is a text box that will have a default value of "WebReference" if
memory serves me right.
Any classes that are publicly exposed via the

Nov 23 '05 #2

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

Similar topics

by: Burak | last post by:
Hello, I have a web service that has a two user defined public classes. For sake of brevity, I'll write them as follows Public Class Service1 Public Class Class1 Public x as integer End...
by: Tarren | last post by:
Hi: What would be some standard convention to follow when writing web services for return types for .NET only data types? I initially wrote my web service that returns some XML as...
by: RJ | last post by:
I've been trying to find documentation that explains limitation of possible types that a webmethod can return. I realize xml serialization must take place to return the specified type. Must the...
by: Anthony Biondo Jr | last post by:
I was wondering how to handle an error in a web service. If our web service encounters a connection error or any other error what is the best practice for returning an error? Do you return a...
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...
by: andreas.baus | last post by:
Hi. I created a web service (using Apache Axis) and a client for accessing it (using .NET 1.1, C# and WSE2.0), and I noticed a strange phenomenon: When the service sends it's responses using the...
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
by: ntxsoft | last post by:
Hello everybody, I have a small problem while returning array from web service. Firstly I'm new at java web services and I'm using netbeans 6 with glassfish 2. The problem is I have a class, name is...
by: ctj951 | last post by:
I have a very specific question about a language issue that I was hoping to get an answer to. If you allocate a structure that contains an array as a local variable inside a function and return...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.