Returning a typed DataSet from a webservice

  • Thread starter Dionisie Andrei
  • Start date
D

Dionisie Andrei

Hello,

I'm dealing with a rookie problem. I have a very simple webservice that
exposes a function that returns a typed datased named UserDataset. This
dataset is autogenerated from an xsd but is imported from another assembly.
Also, the data access layer is imported from another assembly.

So, my function is something like this:
[WebMethod]
public XApp.Common.Data.Useri.UserDataSet GetUseri()
{
XApp.Common.Data.Useri.UserDataSet dsUser = null;
using(XApp.DataAccess.Users u = new XHonda.DataAccess.Users())
{
dsUser = u.GetUseri();
}
return dsUser;
}
In the client, the consumer, i have a datagrid where I want to show this
dataset...
private void btnGetUseri_Click(object sender, System.EventArgs e)
{
TesterWS.TesterWebService myWS = new TesterWS.TesterWebService();
DataSet dsUsers = myWS.GetUseri();
//XApp.Common.Data.Useri.UserDataset dsU =
(XApp.Common.Data.Useri.UserDataset)dsUsers;
dgUseri.DataSource = dsUsers;
dgUseri.DataMember = "Users";
}
My problem is I don't know how to get that dataset as a
XApp.Common.Data.Useri.UserDataSet ! The datatset I get back from the
webservice is of type TesterWS.UserDataset and I can't even cast to the
original type. Any ideea ?
 
L

Louis Yeung

Andrei,

I am by no mean an expert in this area. My understanding is that the WSDL
definition does not pass the inheritance information of your server class.
Your client proxy is creating the equivalent class based on the WSDL
information. Therefore, your client proxy class is only a close image but not
identical to your server class. Client proxy class is not a typed dataset.
For example, your client can be a Java application, their world has no such
thing = typed dataset.

...Louis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top