Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4021924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:24:40+00:00 2026-05-20T10:24:40+00:00

I have a web service (an ASP.NET .asmx page), and for debugging purposes I

  • 0

I have a web service (an ASP.NET .asmx page), and for debugging purposes I need to log all calls to the webservice, including values of all parameters passed into each call. So basically the first thing each WebMethod should do is log it’s state with details of all the parameter values passed in to it.

So far so good. The complication is that I also want an automated way of getting the parameter values – there’s quite a few webmethods with different signatures, and some of them have up to ~30 parameters, so manually coding against each specific parameter would likely be massively error-prone. I’d rather be able to call a method that looks at the current Http context and automatically uses that to grab and parse whatever has been passed in by the client.

But I hit a snag. When I look at HttpContext.Current.Request, it turns out that both the Form and QueryString collections are empty. So if the arguments passed to the webmethod aren’t in either of those collections, where would they be? Anyone know how I can retrieve them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:24:41+00:00Added an answer on May 20, 2026 at 10:24 am

    You can use AOP techniques for this task. Considering PostSharp, you can create custom aspect like this:

    [Serializable]
    public class TraceAttribute : OnMethodBoundaryAspect
    {
        public override void OnEntry(MethodExecutionArgs args)
        {
            Trace.WriteLine(string.Format("Entering {0}", args.Method.Name));
    
            for (int i = 0; i < args.Arguments.Count; i++)
            {
                Trace.WriteLine(string.Format("    {0}", args.Arguments.GetArgument(i)));
            }
        }
    }
    

    and then apply it to your web-service methods:

    [WebMethod, Trace]
    public string HelloWorld()
    {
        return "Hello World";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web service (in asp.net) and I would like to have each
I have an ASP.NET web service which does some heavy lifting, like say,some file
I have deployed ASP.NET web site and ASP.NET web service on the same web
I have some ASP.NET web services which all share a common helper class they
I have some ASP.NET page and webservice WebMethod() methods that I'd like to add
The old ASP.NET ASMX Web services used to produce a Web page that allowed
I have a problem with some basic ajax and asp.net web service. In my
I've written an ASP.NET webservice (.asmx style rather than WCF) and I have the
I have a webservice that exists in an asp.net website. When I publish the
I have an ASP.NET webservice with along the lines of: [WebService(Namespace = http://internalservice.net/messageprocessing)] [WebServiceBinding(ConformsTo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.