Not able to access the sharepoint site from an external machine RRS feed

  • Question

  • I created a list in a sharepoint site (2007). I was trying to access that list from another machine in which WSS is installed. But I am getting the following error.

      The Web application at http://mysite.com/Test/ 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

    I used the following code

    using (SPSite siteCollection = new SPSite("http://mysite.com/Test/"))
                SPWeb web = siteCollection.OpenWeb();
                SPList list = web.Lists["ListName"];
                SPListItem oListItem = list.Items.GetItemById(Convert.ToInt32("1"));
                lblDocumentName.Text = oListItem["Name"].ToString();

    Any suggessions, why is error occurs
    • Edited by EstoySol Tuesday, November 29, 2011 10:43 AM
    Tuesday, November 29, 2011 10:42 AM


  • Hi,

    SPSite is part of SharePoint Object Model(OM). The SharePoint OM can only be run in the server where SharePoint is installed and deployed. So, accessing a different sharepoint server(web application) from a different server(machine) through object model will not work and will report the error whcih is appearing for you. If you want to you use it from outside then look for SharePoint web services.

    Hope this clarifies your problem.

    Tuesday, November 29, 2011 11:10 AM