Question

I'd like to access data from a list in one web application in another web application. They are both in the same farm. For instance, web app 1 has a custom list and web app 2 has a CQWP that wants to show the web app 1 list. In my case, I have a MySite collection (web app 2) which needs to consume data from our main site (web app 1) where data is maintained centrally.

Is there a way to use something like crossdomain.xml and/or clientaccesspolicy.xml to do this?

Was it helpful?

Solution

Since your web applications are within the same farm, you can even use the object model to query the data. It's been a while since I've re-checked this, but from what I can remember one of the following conditions must be true.

1) Your application pool identity for web app 1 must be the same as the app pool identity for web app2, OR

2) The application pool identity of web app 1 must have sufficient rights to the content database for web app2.

In both cases its to do with the permissions on the relevant content DBs

I should also mention that the calling user would need to have permissions to access the data being retrieved.

OTHER TIPS

I have developed custom web parts, and also used some third party web parts to do this in the past by going through the web services.

Since it is available via web services you also have the option of using an ajax library like jQuery or the SPServices project which makes that even easier.

SPServices - http://spservices.codeplex.com/

You could create a Data View Web Part in SPD using a data source pulling in the lists web service on your other web application.

Or alternatively as Mike has said take a look at SPServices.

Or if you want to develop something then you can use the OM as Paul has mentioned.

So you have many options to achieve this.

The basic idea here is that whilst this is achievable in many ways there is probably only one optimal way for your requirements. If you want more information then as SPEvilGenius has stated you must give us all more information on the requirements that you are working with.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top