ChadMarsh
asked on
Renaming nodes in an XML file
Hello,
I wrote a wrapper to consume a proprietary web service. It works good except the xml that the web service returns has some child nodes that are the same as the parent node so my dataset ignores the child.
Since I can't get the source to the webservice to change it, Would there be way I could loop through the file aand change either one so they are not the same? If I manually run the service, save the file, and edit the value it works fine. Here is an example
<responsible>
<responsibleid>123456789</ responsibl eid>
<responsible>John Smith</responsible>
</responsible>
The web services returns it as a string so this is what I'm using to put it in a dataset
public DataSet tickets()
{
EntryWrapper.entry.Service 1 ticket = new EntryWrapper.entry.Service 1();
ticket.Credentials = new System.Net.NetworkCredenti al("name", "password", "OGI");
string strWeb = ticket.ReportTest("F241A90 5-89B1-416 d-8DC2-8C2 EA1A6B434" , "");
XmlTextReader xml_reader = new XmlTextReader(new StringReader(strWeb));
DataSet relational_data = new DataSet("ogi_team");
relational_data.ReadXml(xm l_reader);
return relational_data;
}
Thanks for any help
I wrote a wrapper to consume a proprietary web service. It works good except the xml that the web service returns has some child nodes that are the same as the parent node so my dataset ignores the child.
Since I can't get the source to the webservice to change it, Would there be way I could loop through the file aand change either one so they are not the same? If I manually run the service, save the file, and edit the value it works fine. Here is an example
<responsible>
<responsibleid>123456789</
<responsible>John Smith</responsible>
</responsible>
The web services returns it as a string so this is what I'm using to put it in a dataset
public DataSet tickets()
{
EntryWrapper.entry.Service
ticket.Credentials = new System.Net.NetworkCredenti
string strWeb = ticket.ReportTest("F241A90
XmlTextReader xml_reader = new XmlTextReader(new StringReader(strWeb));
DataSet relational_data = new DataSet("ogi_team");
relational_data.ReadXml(xm
return relational_data;
}
Thanks for any help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER