locked
Root element is missing RRS feed

  • Question

  • User1002588428 posted

    Root element is missing.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Xml.XmlException: Root element is missing.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [XmlException: Root element is missing.]
       System.Xml.XmlTextReaderImpl.Throw(Exception e) +76
       System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) +61
       System.Xml.XmlTextReaderImpl.ParseDocumentContent() +3979720
       System.Xml.XmlTextReaderImpl.Read() +151
       System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +112
       System.Xml.XmlDocument.Load(XmlReader reader) +108
       System.Xml.XmlDocument.LoadXml(String xml) +113
       Google.Apps.SingleSignOn.SamlParser.UnpackRequest(String packedText) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\src\SamlParser.cs:53
       Google.Apps.SingleSignOn.SamlParser.CreateSignedResponse(String packedSamlRequest, String userName, String& responseXml, String& actionUrl) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\src\SamlParser.cs:117
       Google.Apps.SingleSignOn.Web.SingleSignOn.SetupGoogleLoginForm(String userName) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\web\SingleSignOn.aspx.cs:75
       Google.Apps.SingleSignOn.Web.SingleSignOn.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\web\SingleSignOn.aspx.cs:54
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    



    Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4209

     

    I'm getting the error above on an ASP.NET application for a google API i'm using. I've checked permissions and that the XML file is good... can anyone help?
     

    <!-- [XmlException]: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res) 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.LoadXml(String xml) at Google.Apps.SingleSignOn.SamlParser.UnpackRequest(String packedText) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\src\SamlParser.cs:line 53 at Google.Apps.SingleSignOn.SamlParser.CreateSignedResponse(String packedSamlRequest, String userName, String& responseXml, String& actionUrl) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\src\SamlParser.cs:line 117 at Google.Apps.SingleSignOn.Web.SingleSignOn.SetupGoogleLoginForm(String userName) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\web\SingleSignOn.aspx.cs:line 75 at Google.Apps.SingleSignOn.Web.SingleSignOn.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\web\SingleSignOn.aspx.cs:line 54 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.singlesignon_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\googleappssso\9b04f7a2\709341d8\App_Web_hprolfeq.2.cs:line 0 at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) [HttpException]: Error executing child request for SingleSignOn.aspx. at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path) at Google.Apps.SingleSignOn.Web.SignIn.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\XPMUser\Desktop\sso-sample-1.0.1-cs2\cs\Google.Apps.SingleSignOn\web\SignIn.aspx.cs:line 39 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.signin_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\googleappssso\9b04f7a2\709341d8\App_Web_hprolfeq.3.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->
    Wednesday, November 17, 2010 3:50 PM

All replies

  • User-2010311731 posted

    Could you post the XML?

     

    Matt 

    Wednesday, November 17, 2010 5:44 PM
  • User1002588428 posted

    Hi, here it is:

     

    <samlp:Response ID="%ResponseId%" IssueInstant="%IssueInstant%" Version="2.0"
      xmlns="urn:oasis:names:tc:SAML:2.0:assertion"
      xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
      xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
      <samlp:Status>
        <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
      </samlp:Status>
      <Assertion ID="%AssertionId%"
        IssueInstant="2003-04-17T00:46:02Z" Version="2.0"
        xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
        <Issuer>https://www.opensaml.org/IDP
        </Issuer>
        <Subject>
          <NameID
            Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">
            %Username%
          </NameID>
          <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
            <SubjectConfirmationData
              Recipient="%AcsUrl%"
              NotOnOrAfter="%NotOnOrAfter%"
              InResponseTo="%InResponseTo%"/>
          </SubjectConfirmation>
        </Subject>
        <Conditions
          NotBefore="%NotBefore%"
          NotOnOrAfter="%NotOnOrAfter%">
          <AudienceRestriction>
            <Audience>%AcsUrl%</Audience>
          </AudienceRestriction>
        </Conditions>
        <AuthnStatement AuthnInstant="%AuthnInstant%">
          <AuthnContext>
            <AuthnContextClassRef>
              urn:oasis:names:tc:SAML:2.0:ac:classes:Password
            </AuthnContextClassRef>
          </AuthnContext>
        </AuthnStatement>
      </Assertion>
    </samlp:Response>

    Wednesday, November 17, 2010 5:57 PM
  • User1002588428 posted

    I think I posted the wrong XML file in the previous post, here is the one from the web.config file:

     

    <?xml version="1.0"?>
    <configuration>
     <!-- Application specific settings -->
     <appSettings>
        <add key="Google.Apps.SingleSignOn.PfxFile" value="C:\inetpub\vhosts\test123.com\iicert\testmail.pfx"/>
        <add key="Google.Apps.SingleSignOn.Url" value="SingleSignOn.aspx"/>
     </appSettings>
     <system.web>
      <!--  DYNAMIC DEBUG COMPILATION
              Set compilation debug="true" to enable ASPX debugging.  Otherwise, setting this value to
              false will improve runtime performance of this application.
              Set compilation debug="true" to insert debugging symbols (.pdb information)
              into the compiled page. Because this creates a larger file that executes
              more slowly, you should set this value to true only when debugging and to
              false at all other times. For more information, refer to the documentation about
              debugging ASP.NET files.
        -->
      <compilation defaultLanguage="c#" debug="true"/>
      <!--  CUSTOM ERROR MESSAGES
              Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
              Add <error> tags for each of the errors you want to handle.

              "On" Always display custom (friendly) messages.
              "Off" Always display detailed ASP.NET error information.
              "RemoteOnly" Display custom (friendly) messages only to users not running
               on the local Web server. This setting is recommended for security purposes, so
               that you do not display application detail information to remote clients.
        -->
      <customErrors mode="RemoteOnly"/>
      <!--  AUTHENTICATION
              This section sets the authentication policies of the application. Possible modes are "Windows",
              "Forms", "Passport" and "None"

              "None" No authentication is performed.
              "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
               its settings for the application. Anonymous access must be disabled in IIS.
              "Forms" You provide a custom form (Web page) for users to enter their credentials, and then
               you authenticate them in your application. A user credential token is stored in a cookie.
              "Passport" Authentication is performed via a centralized authentication service provided
               by Microsoft that offers a single logon and core profile services for member sites.
        -->
      <authentication mode="Windows"/>
      <!--  AUTHORIZATION
              This section sets the authorization policies of the application. You can allow or deny access
              to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
              (unauthenticated) users.
        -->
      <authorization>
       <allow users="*"/>
       <!-- Allow all users -->
       <!--  <allow     users="[comma separated list of users]"
                                 roles="[comma separated list of roles]"/>
                      <deny      users="[comma separated list of users]"
                                 roles="[comma separated list of roles]"/>
                -->
      </authorization>
      <!--  APPLICATION-LEVEL TRACE LOGGING
              Application-level tracing enables trace log output for every page within an application.
              Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
              trace information will be displayed at the bottom of each page.  Otherwise, you can view the
              application trace log by browsing the "trace.axd" page from your web application
              root.
        -->
      <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
      <!--  SESSION STATE SETTINGS
              By default ASP.NET uses cookies to identify which requests belong to a particular session.
              If cookies are not available, a session can be tracked by adding a session identifier to the URL.
              To disable cookies, set sessionState cookieless="true".
        -->
      <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>
      <!--  GLOBALIZATION
              This section sets the globalization settings of the application.
        -->
      <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
      <xhtmlConformance mode="Legacy"/></system.web>
    </configuration>

    Wednesday, November 17, 2010 8:11 PM