我正在開發iOS iPad應用程序以連接到Sharepoint。我正在用ASIHTTPRequest框架來做這件事。我的代碼看起來像這樣:iOS Sharepoint App登錄錯誤
NSURL *url = [NSURL URLWithString:@"https://SHAREPOINTURL"];
NSString *soapMessage = @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">\n"
"<soap12:Body>\n"
"<GetListCollection xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\" />\n"
"</soap12:Body>\n"
"</soap12:Envelope>\n";
asiRequest = [ASIHTTPRequest requestWithURL:url];
[asiRequest setUsername:@"USERNAME"];
[asiRequest setPassword:@"PASSWORD"];
[asiRequest setDelegate:self];
[asiRequest appendPostData:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
[asiRequest addRequestHeader:@"Content-Type" value:@"text/xml; charset=utf-8"];
[asiRequest startAsynchronous];
到目前爲止,這麼好,但是當我調試這個,我得到一個403 FORBIDDEN錯誤。爲什麼? 在我看來,我不認爲這些錯誤是用戶名和密碼。請求可能有問題嗎?
嗯..一定有一個錯誤。唯一的想法是服務器返回idt this:<?xml version =「1.0」encoding =「utf-8」?> soap:客戶端 無法無需有效的操作參數即可處理請求。請提供有效的肥皂動作。 faultstring> soap:Envelope> –
user1913839