Custom Web Part to Display Data from Another Farm
We have a requirement to display SPList items from a separate farm which resides in the Same Forest. we have 2 domains (Domain A, Domain B) which are in the same Forest. and both the domain has their own SharePoint Environment. we need to display data from a site in Domain A SPList, using a web part in Domain B Site. is there a way of doing this ?
February 16th, 2015 6:38am

Hi Mohamed,

yes you can do that, use client object model to access the other farm.

check the following sample for the code:

https://code.msdn.microsoft.com/SharePoint-2013-Perform-eba8df54

var spUser = clientContext.Web.CurrentUser;
clientContext.Load(spUser, user => user.Title, user => user.LoginName);
List list = web.Lists.Add(...);
ctx.ExecuteQuery(); //Create the list
ctx.Load(list, l => l.DefaultViewUrl); // Request the new list's URL
ctx.ExecuteQuery(); // Get the new list'

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 6:45am

Hi Mohamed,

yes you can do that, use client object model to access the other farm.

check the following sample for the code:

https://code.msdn.microsoft.com/SharePoint-2013-Perform-eba8df54

var spUser = clientContext.Web.CurrentUser;
clientContext.Load(spUser, user => user.Title, user => user.LoginName);
List list = web.Lists.Add(...);
ctx.ExecuteQuery(); //Create the list
ctx.Load(list, l => l.DefaultViewUrl); // Request the new list's URL
ctx.ExecuteQuery(); // Get the new list'

February 17th, 2015 12:11am

Hi,

In this case you can use the publishing the custom service application across different farms.

Share service applications across farms in SharePoint 2013,

and

Cross farm Service Applications Integration between two separate SharePoint far

February 17th, 2015 12:42am

is it possible to use http://www.codeproject.com/Articles/31228/Building-SharePoint-Web-Service-Dynamically-and-Ac approach on a web part by customizing? will it work ? any thoughts ?
February 17th, 2015 1:50am

Hi,

If you choose to work on client side, then REST API is the best option, before you need to allow the list can be accessed through anonymous enabled.

Explore this REST API in SharePoint 2013.

You can also try the SharePoint App model (Provider hosted app) to create the high trust app ( on-prem

Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 2:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics