Web service call webmethod throws HTTP / 1.1 404 Not found

I have a piece of code in which there are 2 consecutive calls to the good old ASMX web service.

service.Url = "http://....."; service.A(1, 2, 3); service.B(4, 5, 6); 

Call A is OK. But calling B throws 404... not found... In the discovery, both methods are visible and seem accurate - I see how in IE, metadata looks good. I set a breakpoint at B and it definitely won't hit. I restored the Update Web Service link in the consumption project and rebuilt it.

The status of WebExceptionStatus.ProtocolError .

Signature of a failed web method

 <WebMethod(Description:="Store a fragment of object on server.")> _ Public Function B( ByVal p1 As String, ByVal p2 As String, ByVal p3() As Byte, ByVal p4 As Integer, ByVal p5() As Byte) As Boolean 

Call (confirmed)

 bool result = service.B(string, string, byteArray1, int, byteArray2); 

Again, WebMethod B is not reached. The web proxy server and everything look good. What could it be?

+5
source share
1 answer

I solved it. This was confusing since I was getting HTTP/1.1 404 Not Found and WebExceptionStatus.ProtocolError .

As soon as I plugged in Fiddler2, I dug in it and found a WebView in which it clearly says:

โ€ข Request filtering is configured on the web server to reject the request because the content is longer than the configured value.

To solve the problem, I changed the configuration in IIS to allow 50 MB requests.

Change request properties

And you also want to have the following setting in web.config

 <httpRuntime maxRequestLength="1000000" executionTimeout="3000"/> 

Maximum value 2097151 KB

404 is confusing. This sounded like a web service issue, while in reality it was the size of the request. And when I said that it worked before, it is simply because before I will not save such large objects as me, by this time.

+5
source

All Articles