have your webservice return a System.Xml.XmlElement. Something like the
following.
[WebMethod]
public System.Xml.XmlElement GetElement()
{
System.Xml.XmlDocument doc= new System.Xml.XmlDocument();
doc.Load(TheFile);
return doc.DocumentElement ;
}
The webservice client will get an XmlElement, which can be loaded into an
XmlDocument, or saved, or transformed into an HTML table, or whatever.
-Dino
> Hello,
> Long day for me, so apologies in advance if I'm asking where the trees
[quoted text clipped - 43 lines]
> }
> }
Curt Krueger - 02 Mar 2005 16:17 GMT
Thanks for the help Dino. What I didn't realize is that I can take this
byte stream and send it down to the browser in the same format. As long as
I describe the content type in the response object, it automatically decodes
back to the original. Here's the code that works for anyone that's
interested.
private void btnDownload_Click(object sender, System.EventArgs e)
{
byte[] fileStream = null;
ErrorReporting er = new ErrorReporting(); // The web service call
fileStream = er.GetErrorLog(out error);
if (null != error)
return;
int length = fileStream.GetUpperBound(0) + 1;
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=errorlog.xml");
Response.AddHeader("Content-Length", length.ToString());
Response.ContentType = "application/octet-stream";
Response.OutputStream.Write(fileStream, 0, length);
Response.End();
}
Works like a charm!
Regards,
Curt
> have your webservice return a System.Xml.XmlElement. Something like the
> following.
[quoted text clipped - 11 lines]
>
> -Dino
> > ======================
> > Any web pages/code examples to do the following, only in "text" or format?
[quoted text clipped - 25 lines]
> > }
> > }