wildbrookmedia
asked on
How can I return xml from a webservice instead of a dataset?
I am trying to load my data that I get from the db as a dataset into xml so i can return it and work with it in Flash. How can I do this? (it is a webservice)
[WebMethod(Description = "Return all employees in the database as xml.")]
public XmlDocument GetAllPeopleRelXML()
{
ConnectionStringSettings setting = ConfigurationManager.Conne ctionStrin gs["Employ eeConnecti onString"] ;
string constring = setting.ConnectionString;
dsEmployee ds = new dsEmployee();
SqlConnection conn = new SqlConnection(constring);
conn.Open();
dsEmployeeTableAdapters.sp SelPersonA llRelTable Adapter personDA = new dsEmployeeTableAdapters.sp SelPersonA llRelTable Adapter();
personDA.Connection = conn;
personDA.Fill(ds.spSelPers onAllRel);
XmlDataDocument datadoc = new XmlDataDocument();
ds.WriteXml(datadoc);
return datadoc;
}
[WebMethod(Description = "Return all employees in the database as xml.")]
public XmlDocument GetAllPeopleRelXML()
{
ConnectionStringSettings setting = ConfigurationManager.Conne
string constring = setting.ConnectionString;
dsEmployee ds = new dsEmployee();
SqlConnection conn = new SqlConnection(constring);
conn.Open();
dsEmployeeTableAdapters.sp
personDA.Connection = conn;
personDA.Fill(ds.spSelPers
XmlDataDocument datadoc = new XmlDataDocument();
ds.WriteXml(datadoc);
return datadoc;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It depends on what you are trying to serialize and deserialize with SOAP to process the web requests. It is difficult to say with any certainty without understanding the entire problem space in more detail.
Bob
Bob
ASKER
For now I am just playing with writing webservices in C# and playing with them in flash. What I am trying to do is write a front end application for a family history web service that I have added a few methods too.
ex here:
http://blogs.msdn.com/coding4fun/archive/2006/10/31/913303.aspx
For the end product I would like to be able to view all family members, update, add, and search for them through the flash interface.
ex here:
http://blogs.msdn.com/coding4fun/archive/2006/10/31/913303.aspx
For the end product I would like to be able to view all family members, update, add, and search for them through the flash interface.
ASKER
Closed it as you answered my question and I was getting off topic...
ASKER
thanks again for the quick reply though!
ASKER
Does your method return a true xml doc or a string that has the format of an xml doc? I wrote some code in Flash to consume the xml doc but it doesnt seem to recognize it as xml...
Thanks!
Thanks!
ASKER
ASKER