locked
How to get Sharepoint External List (WSS) RRS feed

  • Question

  • Hi to all.

    When I create External List in SharePoint Desinger 2010. He create sucsesfully.

    Then i try to get all content from External List. I do this

     

        Microsoft.SharePoint.SPSite mysite = new Microsoft.SharePoint.SPSite("http://anmakarenko/SitePages/Home.aspx");

                SPWeb web = mysite.OpenWeb();

                SPList oList = web.Lists["l2"];  //l2 my external list.

                int myID= olist.Items[1].ID // Thereafter i got exception system.unauthorizedaccessexception

    In Log I see this External List: User passes list permissions check, but an unsupported authentication configuration was identified. Operation disallowed. 

    I have all permissions in Site (Full Control)

    Can somebody help me?

    Tuesday, July 6, 2010 10:05 AM

Answers

  • I am having the same issues and according to all the documentation we should be able to access the External Lists in this way.

    This is being logged in the ULS when I use power shell to access the list

    07/12/2010 23:47:42.95 PowerShell.exe (0x06E0) 0x15FC SharePoint Foundation General g7m5 Medium External List: User passes list permissions check, but an unsupported authentication configuration was identified. Operation disallowed. 

    It might be worth checking your logs to see if it's the same error.

    • Marked as answer by GuYuming Friday, July 16, 2010 7:19 AM
    Monday, July 12, 2010 10:51 PM
  • How did you choose security model for your External Content Type ? According to http://msdn.microsoft.com/en-us/library/ff798353.aspx , meeting security requirements can become more complex when you use the BCD through the runtime APIs or through external lists. The user security token is not available in every context. Without the security token, PassThrough security will not work. Additionally, you will be unable to use the SSS to map the identity of the user to external credentials.

     

    Are you using sandboxed solution for your SPList? Have you read this http://msdn.microsoft.com/en-us/library/ff798440.aspx ?

    • Marked as answer by GuYuming Friday, July 16, 2010 7:19 AM
    Wednesday, July 14, 2010 2:58 AM

All replies

  • Have you tried to browse to the external list?  Do you see all the items in the list?

    In the code, have you tried to do a CAML query on the list and see what the results come up as?

     

    Tuesday, July 6, 2010 10:36 AM
  • External list evalible on Site. In code I see only flields, but items i cant see((((

     When I use ClientContext I can get all items from external List.

    But I need to use WSS.

    Caml is not sutible for me, because he use Httpcontext.....

    Maybe Sharepoint does not provide opportunities to obtain external list with WSS?(Google Translatot)


    Tuesday, July 6, 2010 10:57 AM
  • According to http://msdn.microsoft.com/en-us/library/ff798325.aspx, "As a developer, you can also use the SPList object model to programmatically interact with data through the external list (with some restrictions).", so it should definitely be possible.

     


    MCPD, MCITP, MCTS, MCSD.NET, MCDBA
    Tuesday, July 6, 2010 1:10 PM
  • If you're getting unauthorized access exceptions, modify your code to use SPSecurity.RunWithElevatedPrivileges(). Here is the link to the definition:

    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx

    That should work for you.

     

     

     

    Tuesday, July 6, 2010 1:28 PM
  • I do this 

    Spsecurity.RunWithElevatedpriveleges(delegate{

    My code //But exception still remains

    }

     

     

     

    Tuesday, July 6, 2010 2:32 PM
  • Here is a code snippet that I have to access an external list (using the BCS):

                          SPSecurity.RunWithElevatedPrivileges(delegate()
                          {
                            using (SPServiceContextScope scope = new Microsoft.SharePoint.SPServiceContextScope(SPServiceContext.GetContext(site)))
                            {
                              BdcService service = SPFarm.Local.Services.GetValue<BdcService>(String.Empty);
                              IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);
                              IEntity entity = catalog.GetEntity(nameSpace, entityName);
                              ILobSystemInstance LobSysteminstance = entity.GetLobSystem().GetLobSystemInstances()[0].Value;
    
                              // Get fields in the Entity.
                              IFieldCollection fieldCollection = entity.GetFinderView(strFinderView).Fields;
    
                              // Retrieve all the records in the Entity, and populate XML string (with choices)
                              IMethodInstance methodInstance = entity.GetMethodInstance(strFinderView, MethodInstanceType.Finder);
                              IEntityInstanceEnumerator ientityInstanceEnumerator = entity.FindFiltered(methodInstance.GetFilters(), LobSysteminstance);
    
                              while (ientityInstanceEnumerator.MoveNext())
                              {
                                foreach (IField field in fieldCollection)
                                  strFinalXML += "<CHOICE>" + ientityInstanceEnumerator.Current[field.Name].ToString() + "</CHOICE>";
                              }
                            }
                          });
    

     

    namespace should be set to the URL for your site, and entityName should be set to the name of your external list. This code snippet works for me, as I have an event receiver that accesses an external list for data values, and I create an XML string from that data.

    I hope this helps. If you still get errors, it might help if you paste your code here, so we can see what you're doing (exactly).

     

    Tuesday, July 6, 2010 5:32 PM
  • I am having the same issues and according to all the documentation we should be able to access the External Lists in this way.

    This is being logged in the ULS when I use power shell to access the list

    07/12/2010 23:47:42.95 PowerShell.exe (0x06E0) 0x15FC SharePoint Foundation General g7m5 Medium External List: User passes list permissions check, but an unsupported authentication configuration was identified. Operation disallowed. 

    It might be worth checking your logs to see if it's the same error.

    • Marked as answer by GuYuming Friday, July 16, 2010 7:19 AM
    Monday, July 12, 2010 10:51 PM
  • How did you choose security model for your External Content Type ? According to http://msdn.microsoft.com/en-us/library/ff798353.aspx , meeting security requirements can become more complex when you use the BCD through the runtime APIs or through external lists. The user security token is not available in every context. Without the security token, PassThrough security will not work. Additionally, you will be unable to use the SSS to map the identity of the user to external credentials.

     

    Are you using sandboxed solution for your SPList? Have you read this http://msdn.microsoft.com/en-us/library/ff798440.aspx ?

    • Marked as answer by GuYuming Friday, July 16, 2010 7:19 AM
    Wednesday, July 14, 2010 2:58 AM
  • I have spoken to the support team on this at Microsoft and they have explained the an answer given by GUYuming.

    If you are using SharePoint 2010 Foundation you will be using Connect with User's Identity when configuring your SQL data source as Foundation does not offer the use of the Secure Store.

    If you have SharePoint 2010 Server Standard or Enterprise you will have the Secure Store functionality.  If you use this the error will not occur, if you configure it correctly.

    That leaves Foundation with the error still occuring.

    If you follow this guide it will explain on how to turn on the revert to self authentication that GuYuming has linked earlier.

    http://www.zimmergren.net/archive/2010/06/09/sp-2010-bcs-problem-with-authenticationmode-and-reverttoself.aspx

    Finally you will need to edit the External Content Type in SharePoint designer and click the Edit Connection Properties button in the ribbon and change the the Authentication Mode to BDC Identity, remember to save the changes.

    You will need to ensure that the application pool account that is running the SharePoint site you have configured has permissions to the database.

    Revert to self authentication has a few security implications and you need to read those to make sure you are comfortable with turning on this functionality.

    This has solved all of my issues and I can now use the server based OM.

    Thanks for all the help, and I hope this makes it clearer on how to solve the issue.

    Thursday, July 29, 2010 10:31 AM