Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to know whether managed client object model works in cross domain cases.

For example I have a console application in Domain A, can I use managed client object model in the console application which access data from a sharepoint server in another domain B.

Do I have to add "ClientAccessPolicy.xml" for managed client object model.

any help is highly appreciated and please let me know about the ECMA and silverlight client object model realted to cross domain.

thanks in advance.

share|improve this question

2 Answers 2

If you are using a console app, there is no problem with cross-domain. The console app is actually not running in a "domain". Therefore you don't need the ClientAccessPolicy.xml and can access any SharePoint site.

For Silverlight running in domain A, you need the ClientAccessPolicy.xml on domain B if you want to access it. I'm not sure about JavaScript.

share|improve this answer
    
thanks for the quick response Marco. –  explorer37 May 10 '12 at 19:19
    
thanks for the quick response Marco. What if I am using the .Net managed client object model in a event receiver or webpart in domain A to access data from a different sharepoint server in domain B. Does the managed client object model need any extra settings or not? I just wanna make sure. FYI: In javascript client object model we can not do cross domain, infact we can not do cross site I guess. –  explorer37 May 10 '12 at 19:26
    
I've never used the client OM within an event receiver or a web part, because you can use the server OM. Well, not in your case, so I think you have to try this out ;-) –  marco May 11 '12 at 5:57
    
thanks I will give it a try. –  explorer37 May 11 '12 at 13:43

Marco's answer is correct. I developed a Silverlight web part displaying information retrieved by a HTTP service from other domain. You'd have to deploy either clientaccesspolicy.xml (new from MS, if you use just Silverlight) or crossdomain.xml (originally from Adobe, if you use both Flash and Silverlight) to the root of the web application you access in the other domain.

If you wanted to use the JavaScript OM directly on your page it wouldn't work. The JavaScript OM works only on SharePoint pages and only from within the same site collection. It is meant to help developing sandboxed solutions and not intended for cross-site calls.

Generally for JavaScript you'd have to enable cross-domain JavaScript on the server in the other domain - at least for your pages - to be able to perform the call. I found that in the meanwhile browsers are able to do it when using the usual XMLHttpRequest; I didn't need XDomainRequest in IE. To access SharePoint, you could expose the functionality you need as a REST WS (developed and deployed as a SharePoint solution) and use XMLHttpRequest on your page to call it. Cross-domain access to SharePoint from pure JavaScript YES but pure client solution NO ...

--- Ferda

share|improve this answer
    
One addition: SharePoint has a built-in REST service. You can access it by [site]/_vti_bin/listdata.svc –  marco May 13 '12 at 16:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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