Webservice descriptive error message for System.IndexOutOfRangeException: Index was outside the bounds of the array.

I am setting up clients to use my webservice. Rather than calling it as a webservice, one has typed in the URL I gave them to use for the web service. Of course, since they are not calling it like a webservice, it is generating this error on the screen:
System.IndexOutOfRangeException: Index was outside the bounds of the array.

Is there a way I can retrieve that error and send something more descriptive to the screen. They come back to me that my webservice is broken.

I tried to step through the class, but calling it from the URL doesn't reach the class and generates the error.

Here's the complete error as it sends to the screen:
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)


I'm using asp.net , vb.net specifically if that matters.
thanks!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
 
DimitrisSenior Solution ArchitectCommented:
This exception is thrown before the request actually calls your service
It's a layer above your application and is handled internally.
I don't think that you can do anything about it
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
Is there an error number I can detect in IIS and change the setting in IIS?
thanks!
0
 
DimitrisSenior Solution ArchitectCommented:
IIS probably is able to find the end point
nevertheless, your endpoint waits for either a specific protocol or arguments that are not passed during the call (probably the contract)
therefore throws an exception (probably)
can you post some code ?
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
Not sure why posting code would matter. It's simply a user who takes the URL I give them to use as their endpoint, and they paste it into their browser rather than using a webservice.

I can put a step on the class that should be called, but it never reaches the class at all. You said yourself it's a layer above the application and handled internally.

I just wonder how other businesses display intelligent messages to their users and thought I might find someone experienced with this issue. It would be applicable to every single web service out there.
0
 
DimitrisSenior Solution ArchitectCommented:
as said it's the contract of the endpoint
if the contract is invalid you will not manage to initiate the call in the endpoint
Sorry, without any data , i can't be of any assistance
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.