troubleshooting Question

Web Service - Index was outside the bound of the array

Avatar of AlliedAdmin
AlliedAdmin asked on
7 Comments1 Solution10272 ViewsLast Modified:
This is kind of a 2 part question.
1.  I have a web service that I am trying to get to work with a client.  Whenever I did my testing by adding a reference to it in a site, creating the objects, and submitting to the service, it works.  Now my client is trying to submit the information by using a Request object and building the xml manually, rather than using the objects and letting .Net handle the SOAP Request.  They submitted a test and got the following response from my server:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd=""><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.     at System.Xml.XmlTextReaderImpl.Throw(Exception e)     at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)     at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()     at System.Xml.XmlTextReaderImpl.ParseDocumentContent()     at System.Xml.XmlTextReaderImpl.Read()     at System.Xml.XmlTextReader.Read()     at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()     at System.Xml.XmlReader.MoveToContent()     at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()     at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()     at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()     at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)     at System.Web.Services.Protocols.SoapServerProtocol.Initialize()     at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)     --- End of inner exception stack trace ---</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>

They also sent me the request they sent, and it looks exactly as it should, using the SOAP request structure on my ASMX page.  Does anyone know what that error means?  Or is it too vague?

Now for part 2.  In trying to debug this, I created a Test webmethod that I can invoke by going to my asmx page that emulates a request.  When I run the program and click Invoke, I get this error:
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.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

At first I though maybe I was overlooking something, so I started commenting everything out, but still got the error.  Eventually I created another WebMethod which is completely empty and does nothing:
    public void DoNothing()
When I invoke this method, I still get the above error.  Any ideas?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros