Re: Query Web Service- internal server error
From: hk (hrkn_at_novonordisk.com)
Date: 11/18/04
- Next message: Reg: "RE: Area and DocumentLibrary"
- Previous message: spp: "Re: Search only a Area (or site)"
- In reply to: Mike Linster: "RE: Query Web Service- internal server error"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Nov 2004 09:17:00 +0100
Hi
Here's a solution that works
it seems that the querytext has to treated as CDATA!
queryText = "<![CDATA[select ""DAV:href"", ""DAV:displayname"" ,
""urn:schemas.microsoft.com:fulltextqueryinfo:description"" from
InWear..scope() where contains ('" + textBoxKeyword.Text + "')]]>"
(other code as before)
Kind regards
Henrik
"Mike Linster" <MikeLinster@discussions.microsoft.com> wrote in message
news:65308451-BD21-4E4F-9092-5CDF38064555@microsoft.com...
> Henrik,
>
> In all honesty I did not see anything wrong with your query, but check out
> this blog post
(http://www.paraesthesia.com/blog/comments.php?id=594_0_1_0_C)
> it has a nice utility to show you exactly what type of query is being sent
> and how to set up yours correctly.
>
> HTH
> Mike
>
> "hk" wrote:
>
> > Hi
> >
> > When I try to use the Query Web Service I get this error message:
> >
> > Internal server error message
> >
> > Here is the code:
> >
> > Dim ds As New DataSet
> > Dim row As DataRow
> > Dim search As New SearchService.QueryService
> > Dim query As String
> > Dim queryText As String
> >
> >
> > queryText = "SELECT ""DAV:href"", ""DAV:displayname"" " + _
> > "FROM (TABLE Portal_Content..Scope()) " + _
> > "WHERE CONTAINS('""todo""') "
> >
> > query = "<?xml version=""1.0"" encoding=""utf-8"" ?>" + _
> > "<QueryPacket xmlns=""urn:Microsoft.Search.Query""
> > Revision=""1000"">" + _
> > "<Query domain=""QDomain"" > " + _
> > "<SupportedFormats>" + _
> >
> > "<Format>urn:Microsoft.Search.Response.Document.Document</Format>" + _
> > "</SupportedFormats>" + _
> > "<Context>" + _
> > "<QueryText language=""en-US""
> > type=""MSSQLFT"">" + queryText + "</QueryText>" + _
> > "</Context>" + _
> >
> > "<Range><StartAt>1</StartAt><Count>5</Count></Range>" + _
> > "</Query>" + _
> > "</QueryPacket>"
> >
> > Dim cred As New System.Net.NetworkCredential("user", "password",
> > "domain")
> > search.Credentials = cred
> > ds.Clear()
> > ds = search.QueryEx(query)
> > litContent.Text = ""
> > For Each row In ds.Tables(0).Rows
> > litContent.Text = litContent.Text + row.Item(0) + "<br>" +
> > row.Item(1) + "<br><br>"
> > Next
> >
> >
> >
> >
> > If I use type = STRING in the query and use a simple keyword instead of
> > query text. It Works
> >
> > So as I see it there is either a problem with the mssqlft query
(queryText)
> > or the configuration of the SPS server.
> >
> > Any help will be much appreciated:
> >
> > Kind regards Henrik
> >
> >
> >
> >
- Next message: Reg: "RE: Area and DocumentLibrary"
- Previous message: spp: "Re: Search only a Area (or site)"
- In reply to: Mike Linster: "RE: Query Web Service- internal server error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|