Returning a typed DataSet from a webservice

Discussion in 'ASP .Net Web Services' started by Dionisie Andrei, Apr 6, 2005.

  1. 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 ?
     
    Dionisie Andrei, Apr 6, 2005
    #1
    1. Advertising

  2. Dionisie Andrei

    Louis Yeung Guest

    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 ?
    >
    >
    >
     
    Louis Yeung, Apr 7, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    1,818
    Chris Taylor
    Oct 31, 2003
  2. Nedu N
    Replies:
    2
    Views:
    2,172
  3. Ketchup
    Replies:
    1
    Views:
    259
    Jan Tielens
    May 25, 2004
  4. sys

    Returning typed dataset from a webservice

    sys, Aug 13, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    144
    Jeffrey Hasan
    Aug 13, 2004
  5. N. Shehzad

    returning strongly typed dataset from web service

    N. Shehzad, Mar 2, 2007, in forum: ASP .Net Web Services
    Replies:
    24
    Views:
    718
    John Saunders
    Mar 6, 2007
Loading...

Share This Page