4 Jan 2017

System.IndexOutOfRangeException : .NET WebService

This is surprising thing for me today that I was able to browse the webservice and see it's methods. However, I could not execute methods inside it. When I tried to execute the method, I was getting the below stacktrace.


System.IndexOutOfRangeException: Index was outside the bounds of the array.

   at System.Web.Services.Protocols.HttpServerType..ctor(Type type)

   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()

   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)


After doing a lot of search, I found a solution here

Reason looks wired but the web method "HelloWorld()" has to exist in the web service. When I kept this method, everything started working. Thanks EricKaufman for the solution.

No comments:

Post a Comment