使用jquery通过Web服务从sharepoint检索文档

时间:2010-04-01 13:08:24

标签: jquery web-services sharepoint cordova rhomobile

我正在尝试开发一个可以通过Web服务与MOSS站点交互的移动应用程序。 我希望它能够;

1)检索文件(pdf,doc,docx,excel) 2)以PDF或Excel格式检索报告服务报告。

我将使用phonegap或rhomobile来开发这个应用程序,我知道我可以使用jquery来使用Web服务。

我的问题围绕MOSS Web服务安全性。我将如何处理身份验证?

由于

2 个答案:

答案 0 :(得分:0)

身份验证如何在您的MOSS网站集上运行?是Windows身份验证吗?如果是,则可以在创建Soap Client以访问Web服务时使用模拟:

EndpointAddress endpointAddress = new EndpointAddress("http://site/_vti_bin/Lists.asmx");

//Just create a basicHttpBinding with standard web services settings
SoapClient soapClient = new SoapClient(basicHttpBinding, endpointAddress);

soapClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

请确保您的web.config中允许模拟。寻找节点

<identity impersonate="true" />

答案 1 :(得分:0)

如果您的用户在移动设备上登录了他们的AD帐户,那么Hugo的答案可能会有效。

如果不是这种情况,您的移动应用可以调用您的网络服务。您的Web服务在以允许调用sharepoint服务的用户身份运行的应用程序池中运行。

然后使用impersonate = false调用sharepoint Web服务。

有几件事可能会给你带来问题:

  • 您必须以某种方式验证您的用户,否则您将开放您的sharepoint网站。
  • 通过JSON发送二进制数据也存在问题
  

JSON没有&lt; [CDATA []]&gt;   功能,所以它不太适合   充当声音或图像的载体   或其他大型二进制有效载荷。 JSON   针对数据进行了优化。除了,   提供可执行程序   数据交换系统可以   引入危险的安全问题。

http://www.json.org/xml.html