Note that there are some explanatory texts on larger screens.

plurals
  1. POIIS hosted WCF rest service getting 400 error, is URL too long?
    text
    copied!<p>I have a WCF rest\webHttpBinding service that is returning from browser (IE,Chrome) :</p> <pre><code>Bad Request - Invalid URL - HTTP Error 400. The request URL is invalid. </code></pre> <p>The service uses GET (we probably should change to POST but originally we were told the max url would be 50 characters) and I'm curious as to what the problem is...just for my own piece of mind.</p> <p>We had this issue previously with a url that was over 300 chars so in the web config we set the maxUrlLength, as below.</p> <pre><code> &lt;system.web&gt; &lt;compilation targetFramework="4.0" /&gt; &lt;httpRuntime maxUrlLength ="5000" maxQueryStringLength="2048" /&gt; &lt;/system.web&gt; </code></pre> <p>This was working when did this update but now it does not seem to work, anything over 300 we get a 400 error. </p> <p>I think that something else is blocking the request now. I say this b/c previously we had info in our own log file and in the wcf 'diagnostics' log file. Now neither of those are written to ... its like the service is not even being involved. And previously if I hit the service on the server itself I would get this error </p> <pre><code>The length of the URL for this request exceeds the configured maxUrlLength value. </code></pre> <p>But I no longer get that error.</p> <p>We don't 'own' the server, that is some else is the admin and things have changed on it before without us being informed.</p> <p>I look around on SO but most mentioned setting up diagnostics. There was <a href="http://support.microsoft.com/kb/820129" rel="nofollow">Http.sys registry settings for IIS</a>, which I got from <a href="http://social.msdn.microsoft.com/Forums/eu/wcf/thread/1df4e374-6f88-40d0-9bf3-54e034c7a928" rel="nofollow">http://social.msdn.microsoft.com</a> but nothing seem to be relevant. Also add a section but I believe should be good enough (as per SO answers)</p> <p>Any ideas what might be happening? </p> <p>Thanks!</p> <p>.net 4.0 , iis 7, windows server 2008</p> <p>EDIT: And to add I can update the maxUrlLength to something small, say 50, and use a URL of > 50 and it fails but fails with the "The length of the URL for this request exceeds the configured maxUrlLength value." message. So I'm feeling something else, before it gets to the WCF service, is causing the issue.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload