WCF GET URL Length Limit Issue: Bad Request - Invalid URL

前端 未结 5 2180
心在旅途
心在旅途 2020-12-10 11:14

I tried to access a WCF Service through jQuery AJAX call with GET method. So, sometimes the URL is lengthy with parameters.

When the parameters becomes so lengthy, jQ

5条回答
  •  攒了一身酷
    2020-12-10 11:45

    Reposting the update as Answer, since some of you might jump directly into the Answers section.

    I Found a solution which worked for me, when I research further on this. I'm updating here since it might be useful for others who come across this question.

    This is an IIS Setting

    The problem is because, the default character limit of each parameter in REST url is 260 which is defined in the registry.

    So, you have to update the registry to increase this size limit where the IIS Server / IIS Express is running.

    Following is the location of Registry:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters And the value name is UrlSegmentMaxLength. If it is not there, create one with Type of REG_DWORD. And specify a higher value for value data such as 1000 in hexadecimal or 4096 in decimal.

    This is a http.sys setting. More about http.sys settings : http://support.microsoft.com/kb/820129

    Make sure, you restart the server/machine to apply the registry changes. And that's it.

提交回复
热议问题