astromenix
Technical User
Hello,
I ve got a web service that accepts XmlElement as an input parameter.
Then within my web method i would like to convert it to sting and then pass the string to my the stored procedure and use OPENXML to insert the values to SQL Server.
[WebMethod]
public string StoreBooking([XmlAnyElement]XmlElement booking)
{
XmlDocument doc = new XmlDocument();
StringWriter sw = new StringWriter();
try
{
doc.AppendChild(booking);
XmlTextWriter xw = new XmlTextWriter(sw);
doc.WriteTo(xw);
}
catch (XmlException e)
{
return e.ToString();
}
return doc.ToString();
But for some reason i cant add the XmlElement to the XmlDocument.
Please help me
Thanks in advanse.
I ve got a web service that accepts XmlElement as an input parameter.
Then within my web method i would like to convert it to sting and then pass the string to my the stored procedure and use OPENXML to insert the values to SQL Server.
[WebMethod]
public string StoreBooking([XmlAnyElement]XmlElement booking)
{
XmlDocument doc = new XmlDocument();
StringWriter sw = new StringWriter();
try
{
doc.AppendChild(booking);
XmlTextWriter xw = new XmlTextWriter(sw);
doc.WriteTo(xw);
}
catch (XmlException e)
{
return e.ToString();
}
return doc.ToString();
But for some reason i cant add the XmlElement to the XmlDocument.
Please help me
Thanks in advanse.