【问题标题】:SharePoint search service returns SERVER_ERROR (SQLException)SharePoint 搜索服务返回 SERVER_ERROR (SQLException)
【发布时间】:2011-03-03 21:41:01
【问题描述】:

我有一个简单的 WCF Web 服务客户端,它向/more/_vti_bin/search.asmx 上的 Microsoft Search Server(包含在 SharePoint 2007 中)发送请求

请求已发送

<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;/QueryText&gt;&lt;/Context&gt; &lt;/Query&gt; &lt;/QueryPacket&gt; </queryXml>
</Query></s:Body></s:Envelope>

但响应显示 SQLException 错误

<?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>

【问题讨论】:

  • 我的问题很简单:为什么我会出错?应用程序事件日志和 ULS 中没有任何内容。

标签: wcf sharepoint sharepoint-2007


【解决方案1】:

它说有一个sql异常,你能检查你的sql机器是否有错误吗?

【讨论】:

  • SQL没有问题。网页界面正确回复搜索请求; mossearch.com 工具有效。
【解决方案2】:

您的请求有问题。使用 tool 测试您的搜索服务

【讨论】:

    【解决方案3】:

    经过进一步分析,我了解到问题在于 Soap 查询不是以 XML 声明开头的。

    <?xml version="1.0">
    

    这是完全可能的,并且尊重标准,但 SharePoint 不喜欢这样。

    问题变成:How to force the WCF client to starts with an XML declaration

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多