I have exposed a bunch of webservice from which I send several d开发者_如何转开发ata. 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
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.
Yes, I believe you've a white space, line break or any character before
<?xml version.... (XML declaration).
精彩评论