Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Returning a typed DataSet from a webservice

Reply
Thread Tools

Returning a typed DataSet from a webservice

 
 
Dionisie Andrei
Guest
Posts: n/a
 
      04-06-2005
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 ?


 
Reply With Quote
 
 
 
 
Louis Yeung
Guest
Posts: n/a
 
      04-07-2005
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

"Dionisie Andrei" wrote:

> 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 ?
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
returning strongly typed dataset from web service N. Shehzad ASP .Net Web Services 24 03-06-2007 06:27 PM
Returning typed dataset from a webservice sys ASP .Net Web Services 1 08-13-2004 05:00 PM
[Urgent] Is there a size limit on returning a large dataset or a large typed array from web service? Ketchup ASP .Net Web Services 1 05-25-2004 10:11 AM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 2 10-31-2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 1 10-31-2003 02:39 AM



Advertisments