ASMX "documentation mode" can no longer invoke operations with parameters

Jason Baginski 101 Reputation points
2022-07-07T20:09:42.86+00:00

I have a web service that was created back in 2002 that sits hitting on a site that we've always used to run random things. For example, I have a operation that I pass in a local filename for importing a csv file for importing new products. I haven't run it in a little over a month, but today when I got a new file I tried running and every time I hit the invoke button I get

System.InvalidOperationException: Request format is invalid: .  
   at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()  
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()  

I check the modified date of the asmx file and it hasn't been changed in 3 years. There's been several other changes to code elsewhere in the solution, so I assume something is broken there. I jump over to another project that doesn't have a modified date in newer than a year back and add

[WebMethod()]  
    public string HelloWorld()  
    {  
        return "Hello!";  
    }  
    [WebMethod()]  
    public string HelloWorldWithParam(string name)  
    {  
        return "Hello " + name;  
    }  

If I invoke HelloWorld, I get the expected "Hello!" back. If I invoke HelloWorldWithParam, I get the same error. Note, in case you aren't sure what I mean by "Documentation" mode is, this might spark some memories.

218707-image.png

This issue is only when parameters are being used on the Documentation mode. If I slap on a [ScriptMethod(UseHttpGet=true)] and call via http://localhost:57067/test.asmx/HelloWorldWithParam?name=Jason I get the proper <string xmlns="http://www.lenstock.com/app">Hello Jason</string> back. Same if I write some code to connect to the web service.

Did something happen in the recent .NET security updates or Visual Studio updates? How can I get the functionality back? It's going to be really annoying to have to move all of this stuff out elsewhere when we have all this documentation on how to do different things that we've been doing for two decades now.

Developer technologies ASP.NET Other
{count} votes

1 answer

Sort by: Most helpful
  1. Jason Baginski 101 Reputation points
    2022-07-11T10:54:12.22+00:00

    grumbles After replying, I had a hunch.

    It works correctly in Firefox. This is an Edge problem, not a VS/.NET problem.219439-workswithfirefox.gif

    I thought I'd load up developer tools to try and figure out what was going wrong and it gets even more crazy. If I do a reload on the results, it gives me the results.

    219514-edgesucks.gif

    Sending feedback on Edge.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.