Note that there are some explanatory texts on larger screens.

plurals
  1. POGet list of sites in SharePoint available to user
    primarykey
    data
    text
    <p>I have been trying to use the sharepoint web service (from webs.asmx) GetWebCollection to get a list of the sites available to a user. I have authenticated successfully with with sharepoint and if I hard code in the site path I can get files back. However, when I try and use GetWebCollection I am given a "403 Forbidden" error?</p> <p>What is required to be down differently?</p> <p>Alternatively, is there any way to tell what site the user is automatically assigned to?</p> <p>I am connecting via SOAP (with ASIHTTPRequest) in Objective-C.</p> <pre><code>- (void)getUrl { NSURL *url = [NSURL URLWithString:@"https://[server]/_vti_bin/Webs.asmx"]; requestGetSites = [ASIHTTPRequest requestWithURL:url]; [requestGetSites setDelegate:self]; NSString *soapMessage = @"&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n" "&lt;soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;\n" "&lt;soap:Body&gt;\n" "&lt;GetWebCollection xmlns=\"http://schemas.microsoft.com/sharepoint/soap\" /&gt;\n" "&lt;/soap:Body&gt;\n" "&lt;/soap:Envelope&gt;"; [requestGetSites setUseCookiePersistence:NO]; [requestGetSites setUsername:@"username"]; [requestGetSites setPassword:@"password"]; [requestGetSites appendPostData:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]]; [requestGetSites addRequestHeader:@"Content-Type" value:@"text/xml; charset=utf-8"]; [requestGetSites addRequestHeader:@"Host" value:@"[a server]"]; [requestGetSites addRequestHeader:@"SOAPAction" value:@"http://schemas.microsoft.com/sharepoint/soap/GetWebCollection"]; NSLog(@"Request headers are: %@", [[requestGetSites requestHeaders] description]); [requestGetSites startSynchronous]; </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload