This project is read-only.
1

Resolved

GSA.Query.setOutputFormat(GSALib.Constants.Output.XML_NO_DTD) does not set variable on request

description

It looks like GSALib isn't setting the output=XML_NO_DTD variable correctly on the request to the search appliance which causes an exception to be thrown when the XML parser goes to look for the DTD in the incorrect location. If the variable was set correctly the XML results would not contain a DTD statement.
 
Private Sub DoSearch(ByVal query As String, ByVal page As Integer)
    Dim q As New GSA.Query
    Dim ca As New GSA.ClientAccess()
    Dim res As GSA.Response
 
    q.setSiteCollections(New String() {ConfigurationManager.AppSettings("GSACollection")})
    q.setFrontend(ConfigurationManager.AppSettings("GSAFrontEnd"))
    q.setQueryTerm(New GSA.QueryTerm(query))
    q.setOutputFormat(GSALib.Constants.Output.XML_NO_DTD)
    q.setOutputEncoding(GSALib.Constants.Encoding.UTF8)
    q.setAccess(GSALib.Constants.Access.PUBLIC)
    q.setMaxResults(ResultsPerPage)
    q.setScrollAhead(ResultsPerPage * (page - 1))
    q.setOutputFormat(Constants.Output.XML)
 
    ca.GSAHostAddress = ConfigurationManager.AppSettings("GSAHostAddress")
 
    Try
        res = ca.getGSAResponse(q, Nothing)
 
        WriteResultsSummary(res, page)
        BuildSearchResults(ParseSearchResults(res))
 
    Catch ex As Exception
 
        Throw
    End Try
 
End Sub
 
 
Throws the following Exception:
 
Could not find file 'C:\Documents and Settings\Brian\Desktop\google.dtd'.
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.IO.FileNotFoundException: Could not find file 'C:\Documents and Settings\Brian\Desktop\google.dtd'.
 
Source Error:
 
 
Line 85: XmlTextReader reader = new XmlTextReader(stream);
Line 86:
Line 87: while (reader.Read())
Line 88: {
Line 89: switch (reader.NodeType)

 
Source File: C:\Documents and Settings\Brian\My Documents\Visual Studio 2005\Projects\GSALib\Utils\XMLParser.cs Line: 87
 
Stack Trace:
 
 
[FileNotFoundException: Could not find file 'C:\Documents and Settings\Brian\Desktop\google.dtd'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +328
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1038
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +113
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) +78
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +51
System.Xml.XmlTextReaderImpl.OpenStream(Uri uri) +30
System.Xml.XmlTextReaderImpl.DtdParserProxy_PushExternalSubset(String systemId, String publicId) +177
System.Xml.DtdParserProxy.System.Xml.IDtdParserAdapter.PushExternalSubset(String systemId, String publicId) +16
System.Xml.DtdParser.ParseExternalSubset() +18
System.Xml.DtdParser.ParseInDocumentDtd(Boolean saveInternalSubset) +1369493
System.Xml.DtdParser.Parse(Boolean saveInternalSubset) +43
System.Xml.XmlTextReaderImpl.ParseDoctypeDecl() +321
System.Xml.XmlTextReaderImpl.ParseDocumentContent() +282
System.Xml.XmlTextReaderImpl.Read() +41
System.Xml.XmlTextReader.Read() +12
GSALib.Utils.XMLParser.Parse(TextReader stream) in C:\Documents and Settings\Brian\My Documents\Visual Studio 2005\Projects\GSALib\Utils\XMLParser.cs:87
GSALib.GSA.ResponseBuilder.buildResponse(StreamReader istream, String GSAHostAddress, String path) in C:\Documents and Settings\Brian\My Documents\Visual Studio 2005\Projects\GSALib\GSA\ResponseBuilder.cs:45
GSALib.GSA.ClientAccess.getGSAResponse(Query query, String path) in C:\Documents and Settings\Brian\My Documents\Visual Studio 2005\Projects\GSALib\GSA\ClientAccess.cs:236
Admissions_MajorFinder_Search.DoSearch(String query, Int32 page) in C:\Documents and Settings\Brian\My Documents\Visual Studio 2005\WebSites\UIHome\academics\degreefinder\Search.aspx.vb:62
Admissions_MajorFinder_Search.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\Brian\My Documents\Visual Studio 2005\WebSites\UIHome\academics\degreefinder\Search.aspx.vb:30
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

comments

brianfeucht wrote Mar 4, 2008 at 11:55 PM

I = Dumbass.... sorry disregard this.

mbcizmar wrote May 29, 2011 at 1:10 AM

User error.

wrote Feb 14, 2013 at 3:30 AM

wrote May 16, 2013 at 8:12 AM

wrote May 16, 2013 at 8:12 AM

wrote Jun 14, 2013 at 7:54 AM