我正在开发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