c# - Use of SPSite and SPWeb in a custom Sharepoint web service -
i current coding custom web service sharepoint 2010 site. code designed copy contents of 1 folder on sharepoint.
currently, code uses 'spsite(sourceurl).openweb()' access spweb object site. however, code crashes , gives me following error
the web application @ 'sourceurl' not found. verify have typed url correctly. if url should serving existing content, system administrator may need add new request url mapping intended application.
in code, sourceurl url of main site formatted "https://sitename.com".
thanks help,
scott
edit: here method causes error:
public void copyfoldercontents(string sourceurl, string folderurl, string destinationurl) { using (spweb owebsite = new spsite(sourceurl).openweb()) { spfolder ofolder = owebsite.getfolder(folderurl); //create list of files (not folders) on current level spfilecollection collfile = ofolder.files; //copy files on current level target url copytotarget(collfile, destinationurl); //create list of folders on current level spfoldercollection collfolder = ofolder.subfolders; //copy each of folders , of contents enumeratefolders(collfolder, destinationurl); } }
it seems web service not running in 64bit application pool. sharepoint throws exception if process using api not running 64bit. unsure compile project using correct bitness. see this or this.
Comments
Post a Comment