Asp.net-mvc – How to route legacy QueryString parameters in ASP.Net MVC 3

asp.net-mvcasp.net-mvc-3

I am using a third party service that does an async callback to a URL I provide to them.
So I tell them to use http://www.mysite.com/Status/Incoming.
This must obviously map to an Incoming() method on my StatusController.

However, what I don't have control over is the format of the parameters they call my URL with.
E.g. They will do a callback such as: http://www.mysite.com/Status/Incoming?param1=val1&param2=val2&param3=val3

I want to map this to the parameters of my action method: Incoming(string param1, string param2, int param3)

How do I do this?

I have found a lot of stuff about custom routing, but nothing about legacy QueryString parameters.

Best Answer

There is no such thing as legacy query string parameters. There are query string parameters and they are part of the HTTP specification. And assuming that the http://www.mysite.com/Status/Incoming?param1=val1&param2=val2&param3=val3 url is called you don't need any route to make it map to the following action (the default route will do just fine):

public ActionResult Incoming(string param1, string param2, string param3)
{
    ...
}

The default model will take care of binding those values.