[XmlException: There is invalid data at the root level. Line 1,
position 1.]
System.Xml.XmlTextReader.ParseRoot() +295
System.Xml.XmlTextReader.Read() +127
Microsoft.Web.UI.WebControls.TreeView.ReadXmlSrc(String
TreeNodeSrc, String TreeNodeXsltSrc, String strOuter) +136
Microsoft.Web.UI.WebControls.TreeView.ReadTreeNodeXmlSrc() +80
Microsoft.Web.UI.WebControls.TreeView.OnInit(EventArgs e) +91
System.Web.UI.Control.InitRecursive(Control namingContainer) +234
System.Web.UI.Control.InitRecursive(Control namingContainer) +178
System.Web.UI.Control.InitRecursive(Control namingContainer) +178
System.Web.UI.Page.ProcessRequestMain() +171
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0;
ASP.NET Version:1.0.3705.0
everything functioned perfect in beta but now its not working. i have
installed the correct iewebcontrols available from msdn, and i also
created a new asmx file with fresh controls but whenever the
treecontrol is used the above problem occurs. the treeview is fed with
xml generated from sqlserver directly through http, means through iis
virtual directory management, there is no xml file stored on disk.
any idea on what the error could be and how to resolve it ?
any help appreciated,
tia calderone
Is it bug?
Worked with anandh on finding out the root cause of this issue.
this is a bug and we don't support having any authentication on the xml
files used in the treeview's TreeNodeSrc property.
workarounds:
1. use a fully qualified file path (eg: d:\inetpub\wwwroot\mydoc.xml)
or (eg: \\machine\sharename\filename.xml)
(do not use http protocol (i.e DO NOT USE:
http:\\servername\appname\filename.xml)
Thanks
Venkat Chilakala
This posting is provided AS IS with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
btw, authentication has always been anonymous in iis, i checked that.
ok, microsoft, where are the first patches to vs.net rtm ? :))
appreciate your feedback asap,
regards, calderone
"Alexander Siniougin" <s...@mediachase.com> wrote in message news:<eqGBZkd4BHA.2748@tkmsftngp07>...
pTreeObject.TreeNodeSrc = GetXmlString();
pTreeObject.DataBind();
Now u can use any method to get this XML String and there shouldn't be any
authentication problems.
"calderone" <cald...@nexgo.de> wrote in message
news:417bd7e3.02041...@posting.google.com...
i wrote a small function as a webservice like this so that an xml file
is generated based on a sproc:
<WebMethod()> Public Function GetSQLXML()
Dim xmldoc as new xml.xmlDocument()
xmldoc.Load("http://localhost/ABC?sql=execute+mysproc")
xmldoc.Save("C:\Inetput\wwwroot\webserivce\test.xml")
Then, on the client side i wrote this so that the generated xml file
can be consumed by the treeviewcontrol:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim ws as Webservice1.Service2
ws = New Webservice1.Service2()
ws.GetSQLXML() 'invoking the service to generate the xml-file
Treeview1.TreeNodeSrc = "C:\Inetput\wwwroot\webserivce\test.xml"
Treeview1.DataBind()
End If
End Sub
The problem is: in vs.net beta2 the above code works wonderful, BUT in
vs.net RTM it doesnt. The problem starts when the following like shall
be processed:
xmldoc.Load("http://localhost/ABC?sql=execute+mysproc")
the following error is thrown :
System.Net.WebException: The remote server returned an error: (401)
Unauthorized.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult
asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri,
ICredentials credentials)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String
role, Type ofObjectToReturn)
at System.Xml.XmlTextReader.CreateScanner()
at System.Xml.XmlTextReader.Init()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
at System.Xml.XmlValidatingReader.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader,
Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at DA_Expertenmarkt.Services.GetSQLXML() in
C:\Inetpub\wwwroot\DA_Expertenmarkt\Services.asmx.vb:line 151
Obviously there seems to be an authentication problem, but WHERE ?
sql profiler doesnt show any transaction when invoking the service
alone, only the above error occurs.
i have also checked the machine.config file in the processmodel
section.
*THIS IS DRIVING ME NUTS*
any idea what the problem could be why the http-url seems to be a
problem ???
any help is appreciated!!!
tia, calderone
"Alexander Siniougin" <s...@mediachase.com> wrote in message news:<udcYMNk4BHA.1920@tkmsftngp05>...
We are experiencing the same problem you are having with the tree
control, and we have been working with Microsoft Support on the issue.
We have not received a valid solution from then, and it has been over
3 weeks.
We are also not using a static xml file. We are using an .aspx to
created the xml and setting the appropriate mime type. We have
anonymous access enabled on the web application as well. It appears
that those 2 responses are canned answers that they have for the
treeview (not paying attention to the fact that most people don't use
static xml files).
Keep me posted if you find anything, and I"ll do the same.
--M
cald...@nexgo.de (calderone) wrote in message news:<417bd7e3.02041...@posting.google.com>...
Just FYI....... this is not a fix, but it is interesting. If I add
IUSR_Machinename to the Administrators group on the web server the
error goes away. Obviously this is not a solution due to the security
issues involved, but further investigation may shed some light
regarding what specific security right is corrected by adding the
anonymous user to the Admin group.
If I discover it, I will post here.
--M
cald...@nexgo.de (calderone) wrote in message news:<417bd7e3.02041...@posting.google.com>...
thanks for your feedback. currently i am also investigating the
problem with the treeviewcontrol, but couldnt find a proper reason nor
a fix to it.
anyway, sounds interesting what you did, adding iusr_machinname to the
administrators in iis, will try that.
guess ms will have to quickly develop the first sp1 for vs.net rtm :)
will keep you updated on the development.
Calderone
matthew...@yahoo.com (Matthew Harper) wrote in message news:<58c31510.02041...@posting.google.com>...