471,066 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

How to get the parameters passed to a SOAP webservice

I'd like to log the parameters that were passed to any of the functions

in my webservice. Is there an easier way to get the parameters from the

Request[]? I wrote this function and for simple functions it works:

XmlDocument GetRequestXml() {
XmlDocument doc = new XmlDocument();
doc.AppendChild(doc.CreateElement("request"));
foreach(string key in this.Context.Request.Form.AllKeys) {
XmlElement x = doc.CreateElement(key);
x.InnerXml =
Server.HtmlEncode(this.Context.Request.Form[key]);
doc.DocumentElement.AppendChild(x);
}
foreach(string key in this.Context.Request.QueryString.AllKeys)
{
XmlElement x = doc.CreateElement(key);
x.InnerXml =
Server.HtmlEncode(this.Context.Request.QueryString[key]);
doc.DocumentElement.AppendChild(x);
}
return doc;

}
However if I have a function like this:

[WebMethod]
public string Test1(string[] test) {
...

}
In this case GetRequestXml returns nothing (<request />). I have
methods with lots of parameters and all I want it to log the passed
parameters so I can figure out what happens if something crashed and
debug the service easier.

Jun 6 '06 #1
0 936

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by A.M-SG | last post: by
3 posts views Thread by =?Utf-8?B?UGllcnJl?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.