开发者

SharePoint search service returns SERVER_ERROR (SQLException)

I have a simple WCF webservice client that sends a request to Microsoft Search Server (included with SharePoint 2007) on /more/_vti_bin/search.asmx

The request is sent

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Query xmlns="urn:Microsoft.Search">
<queryXml>&lt;QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000"&gt; &lt;Query&gt; &lt;Context&gt; &lt;QueryText language="fr-FR" type="STRING"&gt;foo bar&lt;/QueryT开发者_如何转开发ext&gt;&lt;/Context&gt; &lt;/Query&gt; &lt;/QueryPacket&gt; </queryXml>
</Query></s:Body></s:Envelope>

But the response shows a SQLException error

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<QueryResponse xmlns="urn:Microsoft.Search">
<QueryResult>&lt;ResponsePacket xmlns="urn:Microsoft.Search.Response"&gt;&lt;Response domain=""&gt;&lt;Status&gt;ERROR_SERVER&lt;/Status&gt;&lt;DebugErrorMessage&gt;System.Data.SqlClient.SqlException&lt;/DebugErrorMessage&gt;&lt;/Response&gt;&lt;/ResponsePacket&gt;</QueryResult>
</QueryResponse></soap:Body></soap:Envelope>


It states there's been a sql exception, coulld you check on your sql machine if any errors occurred?


there is a problem with your request. test your search service using this tool


After some further analysis, I have understood that the problem lies in the fact that the Soap query does not start with an XML declaration.

<?xml version="1.0">

This is perfectly possible and respectful of standards but SharePoint doesn't like that.

The question becomes: How to force the WCF client to starts with an XML declaration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜