Solved

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

Posted on 2016-10-26
5
159 Views
Last Modified: 2016-11-27
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!
0
Comment
Question by:Starr Duskk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
Dimitris earned 500 total points
ID: 41862142
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
 
LVL 2

Author Comment

by:Starr Duskk
ID: 41862510
Is there an error number I can detect in IIS and change the setting in IIS?
thanks!
0
 
LVL 12

Expert Comment

by:Dimitris
ID: 41862818
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
 
LVL 2

Author Comment

by:Starr Duskk
ID: 41864212
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
 
LVL 12

Expert Comment

by:Dimitris
ID: 41871812
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

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question