0

I have exposed a bunch of webservice from which I send several data. The first method will be getting the current datetime from the server. Then rest of the services will be called. Everything works fine. All the webservices will be tested daily. But once in a week, I am getting the below error.

ExceptionData System.Web.Services.Protocols.SoapException: There was an exception running the extensions specified in the config file. ---> 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.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(Stream inStream) at System.Web.Services.Protocols.SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException) at System.Web.Services.Protocols.SoapServerProtocol.Initialize()

Can anyone explain what sort of error it is? Thanks in advance

2
  • Can you please give some code, how you load the XML document? Commented Jan 20, 2011 at 13:54
  • 1
    Generally with a blind guess, I would say your having some DateTime functionality/math in your service which leads to an exception (once a week). Commented Jan 20, 2011 at 13:57

2 Answers 2

1

When you have XML parser errors on line 1, it usually means the file it's trying to parse is not an XML file. It looks like a config file should be an XML file and it's not, or it's not recognizable as one. It you have an error on a different line and column, I'd say this was an format problem in an XML file, but that doesn't appear to be the case here. It's probably not an XML file at all.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes, I believe you've a white space, line break or any character before

<?xml version.... (XML declaration).

1 Comment

or invisible char (ex. in "UTF with BOM" encoding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.