Web Service Help C# VS2005

Discussion in 'ASP .Net Web Services' started by Riley, Nov 17, 2006.

  1. Riley

    Riley Guest

    I have created a dataset based on a MS Access database in a Web Service
    project.. I understand the concept of Web methods, however, I do not
    understand the code I need to write to return this entire (or a subset)
    dataset back to the consumer. Could someone please post the code to do this,
    and/or send me to a good tutorial.? I dont seem to be able to find a proper
    walkthru on the subject. Thanks so much in advance
    Riley, Nov 17, 2006
    #1
    1. Advertising

  2. Riley

    RYoung Guest

    I just noticed this on MSDN:
    http://msdn2.microsoft.com/en-us/library/ms978686.aspx

    If you read through it, the scenario goes through a contract first style of
    service development in regards to the data transfer objects.

    Steps 1, 2, and 3 of that article describe what your looking for.

    It doesn't return datasets, but that's irrelevant to the "message" being
    sent out from the service.

    Basically:
    1) Define your "messages" in Xml Schema first, using Visual Studio's XSD
    designer.
    2) Use xsd.exe to generate classes based on those schemas, add the generated
    code to your project.
    3) Define the service operations (WebMethods) that accept and return data of
    those types.

    At that point, how the generated classes get populated with information is
    up to you. You can hit the database to fill a dataset, then create an
    instance of one of the response messages and populate it with data from the
    dataset.

    Ron

    "Riley" <> wrote in message
    news:...
    >I have created a dataset based on a MS Access database in a Web Service
    > project.. I understand the concept of Web methods, however, I do not
    > understand the code I need to write to return this entire (or a subset)
    > dataset back to the consumer. Could someone please post the code to do
    > this,
    > and/or send me to a good tutorial.? I dont seem to be able to find a
    > proper
    > walkthru on the subject. Thanks so much in advance
    RYoung, Nov 17, 2006
    #2
    1. Advertising

  3. "RYoung" <rcyoungatinkspotdev.com> wrote in message
    news:...
    >I just noticed this on MSDN:
    >http://msdn2.microsoft.com/en-us/library/ms978686.aspx
    >
    > If you read through it, the scenario goes through a contract first style
    > of service development in regards to the data transfer objects.
    >
    > Steps 1, 2, and 3 of that article describe what your looking for.
    >


    Robert has pointed you to "contract-first" development, which is how I
    happen to prefer web services. So I'm playing Devil's Advocate here when I
    show you the other way!

    [WebMethod]
    public DataSet MyMethod(int id)
    {
    dataAdapter.SelectCommand.Parameters[0].Value = id;
    DataSet dataSet = new DataSet();
    dataAdapter.Fill(dataSet);

    return dataSet;
    }


    John
    John Saunders, Nov 18, 2006
    #3
    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. Replies:
    1
    Views:
    347
    Darren Kopp
    Feb 20, 2006
  2. only_me

    vs2005 consuming web service, adding web reference ?

    only_me, Sep 20, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    199
    only_me
    Sep 25, 2005
  3. Anand Vadul
    Replies:
    0
    Views:
    108
    Anand Vadul
    Mar 16, 2006
  4. Harry Simpson

    Web service convert to VS2005 web service

    Harry Simpson, Aug 23, 2007, in forum: ASP .Net Web Services
    Replies:
    4
    Views:
    237
    Harry Simpson
    Sep 7, 2007
  5. Leo Violette
    Replies:
    0
    Views:
    1,003
    Leo Violette
    Apr 17, 2009
Loading...

Share This Page