Comment obtenir des données JSON à partir d'un service distant dans une application SharePoint 2013?

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/52695

Question

Je travaille sur une application pour SharePoint 2013 qui est hébergé SharePoint et je ne peux pas obtenir de données d'un service Web distant à l'aide d'un appel JQuery.ajax.Les deux seules façons d'obtenir des données distantes documentées par Microsoft sont les suivantes: Utilisation d'un appel de proxy Web ou un Page de proxy personnalisée .

Ces méthodes sont-elles les seules que vous pouvez utiliser ou y at-il autre chose disponible?Je cherche quelque chose qui est similaire avec l'appel JQuery.ajax.

Était-ce utile?

La solution

Here is a method to accomplish this: from the JavaScript page code use the jQuery.ajax function with the argument "dataType" set to "jsonp" and call the web service that supports jsonp requests and that returns a json result back.

You can find more details about a .NET specific implementation of a web service and the call code here: Rick Strahl - Creating a JSONP Formatter for ASP.NET Web API. You can get data from any web service that supports jsonp calls: it can be a node.js or a rails service.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top