Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. SharePoint
  4. Custom Web Service for SharePoint

Custom Web Service for SharePoint

Scheduled Pinned Locked Moved SharePoint
sharepointcomhelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christopher Stratmann
    wrote on last edited by
    #1

    I am trying to write a custom web service that is in its own web application that also has its own application pool. When trying to open the site collection using SPSite site = new SPSite("https://www.abc.com"), I get the following error message: (System.IO.FileNotFoundException = The Web application at https://www.abc.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.). Now if I change the application pool to the SharePoint application pool everything works just great. There is a different identity on my new application pool, but I have verified that this identity has access to the site collection. Also, I am running the code within an SPSecurity.RunWithElevatedPrivileges block.

    SPSecurity.RunWithElevatedPrivileges(delegate
    {
    using (var site = new SPSite("https://www.abc.com"))
    {
    using (var web = site.OpenWeb("/Test"))
    {
    ...
    }
    }
    });

    Does anyone have any suggestions? If this is not possible could you point me to an msdn article that states it is not possible? Thanks,

    Chris

    N 1 Reply Last reply
    0
    • C Christopher Stratmann

      I am trying to write a custom web service that is in its own web application that also has its own application pool. When trying to open the site collection using SPSite site = new SPSite("https://www.abc.com"), I get the following error message: (System.IO.FileNotFoundException = The Web application at https://www.abc.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.). Now if I change the application pool to the SharePoint application pool everything works just great. There is a different identity on my new application pool, but I have verified that this identity has access to the site collection. Also, I am running the code within an SPSecurity.RunWithElevatedPrivileges block.

      SPSecurity.RunWithElevatedPrivileges(delegate
      {
      using (var site = new SPSite("https://www.abc.com"))
      {
      using (var web = site.OpenWeb("/Test"))
      {
      ...
      }
      }
      });

      Does anyone have any suggestions? If this is not possible could you point me to an msdn article that states it is not possible? Thanks,

      Chris

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Are you using SharePoint 2010 by any chance? If so you need to build the code as x64.


      I know the language. I've read a book. - _Madmatt

      C 1 Reply Last reply
      0
      • N Not Active

        Are you using SharePoint 2010 by any chance? If so you need to build the code as x64.


        I know the language. I've read a book. - _Madmatt

        C Offline
        C Offline
        Christopher Stratmann
        wrote on last edited by
        #3

        No this is a SharePoint 2007 environment.

        Chris

        N 1 Reply Last reply
        0
        • C Christopher Stratmann

          No this is a SharePoint 2007 environment.

          Chris

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          I would still look at it just to make sure. The error is what happens when attempting to access a 64bit SharePoint from 32bit code.


          I know the language. I've read a book. - _Madmatt

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups