I have constructed a simple web application following the MSDN walk-through as a guide:
Here is the Code Behind:
Protected Sub btnQuery_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnQuery.Click
Try
Dim lcQueryServices As New QueryWebServiceProxy.QueryService()
lcQueryServices.Credentials = System.Net.CredentialCache.DefaultCredentials
'lblErrors.Text = GetXMLString().Replace("<", "<").Replace(">", ">") 'To Test that XML String is rendered correctly
Dim lcQueryResults As System.Data.DataSet = lcQueryServices.QueryEx(GetXMLString())
grdResults.DataSource = lcQueryResults.Tables("RelevantResults")
Catch ex As Exception
lblErrors.Text = ex.ToString()
End Try
End Sub
Private Function GetXMLString() As String
Dim lsQueryXML As XElement = <QueryPacket xmlns='urn:Microsoft.Search.Query'>
<Query>
<SupportedFormats>
<Format revision='1'>urn:Microsoft.Search.Response.Document:Document</Format>
</SupportedFormats>
<Context>
<QueryText language='en' type='FQL'>
<%= GetFQLString() %>
</QueryText>
</Context>
<ResultProvider>FASTSearch</ResultProvider>
<Range>
<Count>10</Count>
</Range>
</Query>
</QueryPacket>
Return lsQueryXML.ToString()
End Function
Private Function GetFQLString() As String
Dim lsFQLString As StringBuilder = New StringBuilder("string(""")
'lsFQLString.Append(txtQuery.Text)
lsFQLString.Append("test"", mode=""and"")")
Return lsFQLString.ToString()
End Function
I am receiving the following error when attempting to query the web service:
System.Web.Services.Protocols.SoapException: Property doesn't exist or is used in a manner inconsistent with schema settings. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at FQLTest1.QueryWebServiceProxy.QueryService.QueryEx(String queryXml) in C:\Users\nealcb\Documents\Visual Studio 2010\Projects\Web Projects\FQLTest1\FQLTest1\Web References\QueryWebServiceProxy\Reference.vb:line 143 at FQLTest1._Default.btnQuery_Click(Object sender, EventArgs e) in C:\Users\nealcb\Documents\Visual Studio 2010\Projects\Web Projects\FQLTest1\FQLTest1\Default.aspx.vb:line 15
Any recommendations?
Update 1.0 3/11/2011
I was able to move my testing to Powershell where I am able to make rapid changes to the query to see if I get any errors. Here is what I found in the logs:
03/11/2011 15:27:51.88 w3wp.exe (0x126C) 0x1274 SharePoint Server Search Query g4hl Medium FastSearchGateway::GetQueryResult--Unrecognized Field Exception searching on QRServer: http://FastQuryServer:13287 -- Exception: Microsoft.SharePoint.Search.Extended.Query.Query.UnrecognizedFieldException: Field Write not found in search results. at Microsoft.SharePoint.Search.Extended.Query.Result.TextResultParser.ReadDocument(TextReader reader) at Microsoft.SharePoint.Search.Extended.Query.Result.TextResultParser.ParseInternal(TextReader reader) at Microsoft.SharePoint.Search.Extended.Query.Result.TextResultParser.Parse(Stream result) at Microsoft.SharePoint.Search.Extended.Query.Http.AbstractUrlBasedSearchEngine.SearchInternal(IQuery query, IResultParser parser, String urlStr) at Microsoft.SharePoint.Search.Extended.Query.Http.AbstractUrlBasedSearc... 6281e480-7d74-4026-87ca-f6a0b93983f9 03/11/2011 15:27:51.88* w3wp.exe (0x126C) 0x1274 SharePoint Server Search Query g4hl Medium ...hEngine.Search(IQuery query) at Microsoft.Office.Server.Search.Query.Gateway.FastSearchGateway.GetQueryResult(IQuery query) 6281e480-7d74-4026-87ca-f6a0b93983f9 03/11/2011 15:27:51.88 w3wp.exe (0x126C) 0x1274 SharePoint Server Search Query g4hk Monitorable AbstractSearchGateway::Search--Exception when searching for string("buchan", mode="and"). Ex: Write 6281e480-7d74-4026-87ca-f6a0b93983f9 03/11/2011 15:27:51.88 w3wp.exe (0x126C) 0x1274 SharePoint Server Search Query g4i1 Monitorable FASTQueryInternal::Execute--Invalid Property Exception when trying to search FAST backend: Write 6281e480-7d74-4026-87ca-f6a0b93983f9 03/11/2011 15:27:51.88 w3wp.exe (0x126C) 0x1274 SharePoint Server Search Query dk68 High SearchServiceApplication::Execute--Exception: Write 6281e480-7d74-4026-87ca-f6a0b93983f9 0
Update 1.1 - Below is my Powershell Script I am using to test this. In speaking with the team, we are leaning towards the property being a duplicate in the managed metadata service (I think). I have verified that the FQL I am transacting is valid. I have decided to run the same script (below) against my dev sharepoint server running on a VM. I just need to get Search enabled first.
$pass = ConvertTo-SecureString "***" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential -ArgumentList "***", $pass
$web = New-WebServiceProxy "http://SearchWebService" -Credential $creds
$lsQueryXML = "<QueryPacket xmlns='urn:Microsoft.Search.Query'><Query><SupportedFormats><Format revision='1'>urn:Microsoft.Search.Response.Document:Document</Format></SupportedFormats><Context><QueryText language='en' type='FQL'>string(`"buchan`", mode=`"and`")</QueryText></Context><Properties><Property Name=`"WorkId`"/><Property Name=`"Rank`"/><Property Name=`"Title`"/><Property Name=`"Author`"/><Property Name=`"Path`"/><Property Name=`"Description`"/><Property Name=`"SiteName`"/><Property Name=`"CollapsingStatus`"/><Property Name=`"HitHighlightedSummary`"/><Property Name=`"HitHighlightedProperties`"/><Property Name=`"ContentClass`"/><Property Name=`"IsDocument`"/><Property Name=`"PictureThumbnailURL`"/><Property Name=`"Url`"/><Property Name=`"ServerRedirectedUrl`"/><Property Name=`"SpSiteUrl`"/><Property Name=`"docvector`"/><Property Name=`"fcocount`"/><Property Name=`"fcoid`"/><Property Name=`"PictureHeight`"/><Property Name=`"PictureWidth`"/></Properties><ResultProvider>FASTSearch</ResultProvider><Range><Count>10</Count></Range></Query></QueryPacket>"
$lcQueryResults = $web.QueryEx($lsQueryXML)