Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strange Exception with WebMethod

Reply
Thread Tools

Strange Exception with WebMethod

 
 
Kevin Spencer
Guest
Posts: n/a
 
      10-25-2004
Hi All,

I'm experienceing a new and strange problem with a WebMethod I am working
on. It creates an instance of a class which contains a number of fields,
Collections, and classes, all of which are serializable (I'm pretty sure).
It compiles fine, and when I run it, I can step through all of the code I
wrote without exception, but it returns the following message:

"There was an error generating the XML document. --> index is outside the
bounds of this Collection"

Anyone have a clue as to where to find the answer to this? I haven't been
able to Google a thing.

--
Thanks,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living


 
Reply With Quote
 
 
 
 
cbDevelopment
Guest
Posts: n/a
 
      10-28-2004
Does this error happen only through code or does it happen if you hit the
ASMX through an application like Web Service Studio (or the local test
page)? If it only happens in code, The place to look would be the
reference.vb file.

You don't have to use the generated classes in the reference.vb, you can
erase them and add whatever imports are neccesary to make it use your
original classes. This might be a good troubleshooting step.



"Kevin Spencer" <(E-Mail Removed)> wrote in
news:#(E-Mail Removed):

> Hi All,
>
> I'm experienceing a new and strange problem with a WebMethod I am
> working on. It creates an instance of a class which contains a number
> of fields, Collections, and classes, all of which are serializable
> (I'm pretty sure). It compiles fine, and when I run it, I can step
> through all of the code I wrote without exception, but it returns the
> following message:
>
> "There was an error generating the XML document. --> index is outside
> the bounds of this Collection"
>
> Anyone have a clue as to where to find the answer to this? I haven't
> been able to Google a thing.
>


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      10-28-2004
Thanks,

I figured it out. There actually WAS an exception occurring, which was being
trapped. When I stepped through the code, I stepped over the method call
that raised the exception. Fortunately, I was also logging exceptions, so
when I went into the log I found the exception and the source of it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"cbDevelopment" <development@remove.700cb.net> wrote in message
news:Xns958FD359943E9cbDevelopment@207.46.248.16.. .
> Does this error happen only through code or does it happen if you hit the
> ASMX through an application like Web Service Studio (or the local test
> page)? If it only happens in code, The place to look would be the
> reference.vb file.
>
> You don't have to use the generated classes in the reference.vb, you can
> erase them and add whatever imports are neccesary to make it use your
> original classes. This might be a good troubleshooting step.
>
>
>
> "Kevin Spencer" <(E-Mail Removed)> wrote in
> news:#(E-Mail Removed):
>
> > Hi All,
> >
> > I'm experienceing a new and strange problem with a WebMethod I am
> > working on. It creates an instance of a class which contains a number
> > of fields, Collections, and classes, all of which are serializable
> > (I'm pretty sure). It compiles fine, and when I run it, I can step
> > through all of the code I wrote without exception, but it returns the
> > following message:
> >
> > "There was an error generating the XML document. --> index is outside
> > the bounds of this Collection"
> >
> > Anyone have a clue as to where to find the answer to this? I haven't
> > been able to Google a thing.
> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Serializing custom exception through a webmethod call. Matt Bush ASP .Net Web Services 1 11-11-2004 10:54 PM
Serializing custom exception through a webmethod call. Matt ASP .Net Web Services 1 11-07-2004 09:19 AM
Returning Enumeration or Exception from WebMethod? Tobias Lekman ASP .Net Web Services 1 08-11-2003 05:26 PM



Advertisments