returning XML data from sqxml webservice

P

Patrick.O.Ige

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?
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top