1
我試圖從客戶端應用程序在.NET 4.5 調用SharePoint 2010的搜索Web服務我,沒有任何問題增加了服務的參考,我修改web.config中允許適當身份驗證(NTLM),但是當我打電話查詢方法,我得到一個500服務器錯誤與消息:500調用2010的Sharepoint當內部服務器錯誤search.asmx
服務器無法處理請求。 --->來自HRESULT的異常:0x80131904 --->;從HRESULT異常:0x80131904
我已經試過幾件事情,什麼我發現真的很讓我爲難:
當使用招來分析的要求,這裏是失敗(只是主體部分)的要求:
<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><QueryPacket xmlns='urn:Microsoft.Search.Query'><Query><SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats><Context><QueryText language='en-US' type='STRING'>ACCORDION</QueryText></Context></Query></QueryPacket>
</queryXml>
</Query>
</s:Body>
</s:Envelope>
當Web服務描述看(通過將瀏覽器指向_vti_bin/search.asmx OP =查詢?),我意識到,現在出現在<s:Body
的命名空間應該在<s:Envelope
。然後,我在Fiddler中編輯請求並反對,現在服務器正確響應。這裏是編輯的請求:
<s:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body >
<Query xmlns="urn:Microsoft.Search"><queryXml><QueryPacket xmlns='urn:Microsoft.Search.Query'><Query><SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats><Context><QueryText language='en-US' type='STRING'>ACCORDION</QueryText></Context></Query></QueryPacket>
</queryXml>
</Query>
</s:Body>
</s:Envelope>
這不是很奇怪嗎?我錯過了什麼嗎?有任何想法嗎?
在此先感謝