returning XML data from sqxml webservice

Discussion in 'ASP .Net Web Services' started by Patrick.O.Ige, Dec 15, 2006.

  1. I want to get a DataSet returned from my SqlXml webservice using a
    storedproc.
    The storedproc returns a simple "Select * from Customers"

    The method below connects to the service and its suppose to return a
    Dataset.

    When i first ran it i got an error :- "Cannot cast Type Dataset to Object"

    So i found a solution using this
    :http://support.microsoft.com/default.aspx?scid=kb;EN-US;815131
    which apparently its a bug.

    So i looked into my webservice "reference.cs" file and changed my spCustomer
    method to

    public System.Data.DataSet spCustomers() {
    object[] results = this.Invoke("spCustomers", new object[0]);
    return ((System.Data.DataSet)(results[0]));
    and the error disspeared.


    public void getXmlWebserivceData()
    {

    TestWebService.devpc1.soap mysoapservice = new devpc1.soap();
    mysoapservice.Credentials =
    System.Net.CredentialCache.DefaultCredentials;

    ds = (DataSet)mysoapservice.spCustomers();
    DataGrid1.DataSource = ds;
    DataGrid1.DataBind();


    }

    The thing is if i configure SqlXml to return a single Dataset using
    storedproc. it works fine but i have another template that executes a
    storedproc but returns XML
    I keep getting error

    "For non-array types, you may use the following attributes: XmlAttribute,
    XmlText, XmlElement, or XmlAnyElement. "

    Any ideas?
     
    Patrick.O.Ige, Dec 15, 2006
    #1
    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. Karuppasamy

    WebService – Returning an Object

    Karuppasamy, Jan 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    544
    Karuppasamy
    Jan 15, 2004
  2. Replies:
    11
    Views:
    681
    Christos Georgiou
    May 2, 2006
  3. Ronchese

    Returning a XML from webservice

    Ronchese, Dec 18, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    331
    John Timney \(MVP\)
    Dec 18, 2006
  4. Molalla Attenborough

    Need help returning data from a vb.net webservice please

    Molalla Attenborough, Dec 29, 2003, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    551
    Patrick Wenzel
    Dec 31, 2003
  5. Milsnips

    need help returning webservice data in arraylist...

    Milsnips, Sep 2, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    157
    Elena Kharitidi
    Sep 23, 2004
Loading...

Share This Page