I extended the DataFormWebPart to use a SoapDataSource and get the data from the lists.asmx webservice
it works fine as long as i access data from the same webapplication but as soon as i try to get some data from another webapplication i get the execption.
System.Net.WebException: The remote server returned an error: (401) Unauthorized
My code looks like this:
private SoapDataSource CreateDataSource(string webUrl, string listName)
{
SoapDataSource source = new SoapDataSource();
source.WsdlPath = string.Format("{0}_vti_bin/lists.asmx?wsdl", webUrl);
source.SelectUrl = string.Format("{0}_vti_bin/lists.asmx", webUrl);
source.SelectAction = "http://schemas.microsoft.com/sharepoint/soap/GetListItems";
source.SelectPort = "ListsSoap";
source.SelectServiceName = "Lists";
source.AuthType = "None";
source.SelectCommand = string.Format(@"<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""><soap:Body><GetListItems xmlns=""http://schemas.microsoft.com/sharepoint/soap/""><listName>{0}</listName></GetListItems></soap:Body></soap:Envelope>", listName);
return source;
}
When i change the type to "Basic" and set the AuthUser and AuthPassword to an authorized user it works (but not with Auth="Windows" The Webapplications have the same apppool user and are on the same farm (i already checked that registry DisableLoopbackCheck-thing))