开发者

AJAX + OData + Basic Auth for Sharepoint 2010's ListData.svc, JSON-P or JSON + xdr

开发者 https://www.devze.com 2023-01-13 16:41 出处:网络
I am looking for a way to either: Do a cross domain plain JSON request a-la YUI IO (http://developer.yahoo.com/yui/3/examples/io/io-xdr.html with Basic Authentication)

I am looking for a way to either:

Do a cross domain plain JSON request a-la YUI IO (http://developer.yahoo.com/yui/3/examples/io/io-xdr.html with Basic Authentication)

or alternatively,

Have Sharepoint 2010's ListData.svc support JSON-P (e.开发者_如何学运维g. /_vti_bin/listdata.svc/?$format=json&$callback=loaded) so I can use jQuery.ajax to make a Basic Authenticated request.

Just to clarify, I'm not sure how the Yahoo example above could support basic authentication (jQuery is a simple mattery). Secondly, the error Sharepoint 2010 throws when attempting JSON-P is:

The query parameter '$format' begins with a system-reserved '$' character but is not recognized.

I know we can retro-fit standard WCF Data Services via http://code.msdn.microsoft.com/DataServicesJSONP but I'm not sure about Sharepoint.

As I am sure some can imagine this would be incredibly useful. Does anyone have an idea of how this could work?


In this situation we ended up accessing the OData service via our .cshtml files using System.Net.WebClient. The application was in the same cloud as the Sharepoint server, so the performance was quite acceptable.

0

精彩评论

暂无评论...
验证码 换一张
取 消