2

I'm trying to integrate a pretty simple REST service from Sharepoint. This service is hosted on a different domain, and I just need to do a GET against it to pull a JSON array of data on page load from one of my content pages.

Obviously, a regular Ajax call fails b/c of same-origin, and so I was hoping there was a native way to proxy or host third party data from inside sharepoint so that my clientside script can get at it.

I did a lot of searching online, and found a /_api/SP.WebProxy.invoke endpoint which allegedly works in 2013, but that doesn't help me much if it doesn't exist in 2010 (I tried using it, and got a 404 error). It's also not very well documented, so I may have the wrong knobs set in my json POST to it.

2
  • 1
    You are correct. It doesn't exist in 2010. You would need to write your own proxy. You could do this either as a custom WCF service or your code could be within the page via code behind. If I were doing this, I would likely choose the WCF method. Commented Feb 24, 2014 at 1:58
  • Thanks, Paul. I'll upvote your question once I am able. I've used all my votes for a 24 hr period. Commented Feb 24, 2014 at 15:02

2 Answers 2

1

You are correct. It doesn't exist in 2010. You would need to write your own proxy. You could do this either as a custom WCF service or your code could be within the page via code behind. If I were doing this, I would likely choose the WCF method.

0

Normal WCF Services don't have cross browser capability. JSONP has been introduced for that. This is a blog which explains how JSONP is used to make a cross domain call

1
  • yeah, if I write a service and add it to my Sharepoint instance, I don't need to worry about that. I was trying to figure out if Sharepoint already had a built-in proxy.
    – Paul
    Commented Feb 24, 2014 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.