如何从javascript调用sharepoint快速搜索Web服务?

时间:2012-09-03 07:54:12

标签: javascript web-services authentication sharepoint-2010 fastsearch

如何从sharepoint快速搜索Web服务调用方法ex:QueryEx,GetQuerySuggestions 我跟着这个 Article

但每次我收到此错误:

<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><faultcode>soap:Client</faultcode><faultstring>Data at the root level is invalid. Line 1, position 1.</faultstring></soap:envelope>

我还用fiddler检查传出消息,我发现正文为0并返回“401 Unauthorized” 有什么想法吗?

1 个答案:

答案 0 :(得分:0)

问题是从JavaScript到WCF服务的跨域调用,所以我在Web应用程序的同一域中创建了一个新的Web服务,并从中使用了其他服务。

javascript ---- call ----&gt;代理网络服务-----致电-----&gt;不同域名的网络服务