Accessing SP 2010 Object Model from Silverlight 4 Application

George Durzi
  • Accessing SP 2010 Object Model from Silverlight 4 Application George Durzi

    I have a Silverlight 4 Beta application where I'd like to use the SharePoint object model to upload a document to a SharePoint site - should be simple enough, except an exception is thrown at:

    using (SPSite siteCollection = new SPSite(siteCollectionUrl))
    

    The Web application at http://intranet.fabrikam.com could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

    This particular exception is actually really well documented out there, it's obviously masking a real underlying issue. Here are some of the things I've read about and tried without success:

    DNS / Host Header: This exception occurs when the particular URL isn't in the IIS metabase because it's being handled by DNS. My web application has an AAM set up and a host header on the web site in IIS. I also tried running the code without using the FQDN of the site, e.g. http: //servername:4860.

    Permissions: The identity of the the Silverlight application pool has db_owner permissions to my content database, and is also a site collection administrator. I can't have both web sites use the same application pool because the Silverlight application needs to run in a .NET app pool.

    x86 vs x64: My Silverlight application has to be compiled for x86 - I'm using some controls that only work in x86. The installed SharePoint version is x64. I've read about people seeing this exception when trying to use the SharePoint object model to hit a x64 SharePoint installation from a x86 app.

    Adding then removing permissions for the account: This begins to border on some voodoo magic, but I read about people magically resolving this issue after removing the permissions they set trying to troubleshoot this problem initially. No luck here.

    Would appreciate any suggestions, thank you!

  • You cannot/should not use the standard SharePoint object model/API's when creating applications that does not run on the actual SharePoint servers. Here is a list of the Web Services in WSS 3.0

    You need to use the web services to interact with SharePoint, or if you are using SharePoint 2010 then use the Client Object Model. Read this overview of the Client Object Model if you are interested

Tags
silverlight
Related questions and answers
  • I am using SharePoint 2007 Server x64 on Windows Server 2008 x64. I create a new SharePoint web application with a new site collection at the root of the web application. I select the template... users who have not logged in yet) of the site. Here is a screen snapshot. Any ideas how to edit this page? Publishing home page http://i33.tinypic.com/2hex08j.png BTW: I have tried to edit... on the site collection for the forms authentication logon page to work from Office SharePoint Server. Contact your administrator to have anonymous access enabled in Central Administration and IIS. Manage

  • that the App pool user for your content web application does not have write access to the Config database, you can't create new TimerJobDefinitions from code that runs in your content web app. A bad... I can think of is to have another timerjob that polls some kind of queue (for example a sharepoint list in my site collection) for new timerjobs to create, and creates it if an item has been added to that queue from within the content web app using the custom schedule admin page. My question is, is there another way that is both efficient and elegant?

  • with that german version, and Google search says nothing about it. I've tried to use that German Sharepoint on 2ndary virtual server and it failed as well so it's not related to this particular VM (still it's same Host thou). I've even downloaded that German version to my Win 7 x64 Enterprise and it started without problem so it doesn't seem like the package is broken on Microsoft servers. Anyone got...I'm having a problem with SharePoint 2010 Foundation in German. I've Windows Server 2008 R2 Enterprise Host and virtual machine with same system. In that virtual machine right after starting

  • create a new Site Column using the SharePoint object model and happen to use http://server/path/site when instantiating the SPSite and SPWeb objects, the site column will be made available but when...Problem: Creating a site column using the SharePoint API (Object Model) with incorrect case in the URL for the SPSite or SPWeb object will cause the new column to throw an exception if an attempt... that is generated is bogus. Clear as mud? Example code: (this is a bad example because of the case sensitivity issue) // note: site should be partially caps: http://server/Path/Site using (SPSite site

  • I'm have some trouble using the GetList web service. It does work sometimes but not at the start of the day!?! Here is my code: public static void ListSurveys(string serverName... because my code had fetched the GUID of the list just milliseconds earlier! Can anyone explain what is going on here? I had the same problem yesterday and at some point it just went away... information using GetList. I use the List GUID as the list name. An exception is thrown. The SOAP body is shown below. <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http

  • , when I try to restore, I get the following errors: Provisioning of the web application, SharePoint - 1234, has encountered the following error: System.ArgumentException: The IIS Web Site you have...I am trying to find the best way to accomplish the following: Move an existing share point application's content and meta databases, back them up and restore them to a different machine. In order to do this I am using the stsadm tool as follows: To backup, I use this command: stsadm -o backup -url http://devpn-004:1234 -directory c:\sharePointBackup -filename testBackup.bak -backupmethod full

  • only site collections/sites using non-publishing templates. All other content is availble e.g. documents, lists Has anyone else come across this? UPDATE 08/05/10: I have been doing some further... in the index under the contentclass:STS_Site and the sites (SPWeb's) are contentclass:STS_Web. The following people seem to have come across this issue and assumed it was just a limitation. I think...This is an old issue I thought this was a bug in an specific environment after reading a couple of blogs it has made me think again... The issue is that SharePoint site collections and sites

  • I try to create a new list in SharePoint 2010 with AddGallery.aspx and the Silverlight app gives me An unhandled exception occurred in the Silverlight Application right when I click the "Create" button. Here is some additional info: Same error across all sites Same error with all types of lists Same error with IE8, Chrome and FireFox Creating the list with SharePoint Designer works fine I have tried recycling the application pool It's a fresh Install; there are no custom solutions deployed I have no idea what could be the source of the problem.

  • without any particular rights: SPF_DATABASE for database credentials SPF_ADMIN for farm credentials Added domain administrator in SQL Server 2008 R2 with sysadmin rights started Sharepoint Powershell as domain administrator (so I have rights to access domain accounts) I didn't install SQL Server 2008 KB 970315 x64, because I'm running R2 version - as I understand this is SQL Server 2008 SP2... : Microsoft.SharePoint.PowerShell. SPCmdletNewSPConfigurationDatabase What am I missing? Is there something else I should configure? Additional info I've also tried disabling firewall, antivirus and UAC but with no luck.

Data information