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>
这不是很奇怪吗?我错过了什么吗?有任何想法吗?
在此先感谢