我最初的肥皂电话是获取所有列表:
//init the soap call format - this gets us all the list on the mobiledev sharepoint
soapFormat = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<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/\">\n"
"<soap:Body>\n"
"<GetListCollection xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\" />\n"
"</soap:Body>\n"
"</soap:Envelope>\n"];
然后我找到我正在寻找的特定列表并再次调用以获取该列表的内容:
if([[attributeDict objectForKey:@"Title"] isEqualToString:@"SharePoint Data Test"]) {
//get the list name
NSString* strListName = [attributeDict objectForKey:@"Name"];
//reset the soap call to get the list data we are looking for
soapFormat = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<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/\">\n"
"<soap:Body>\n"
"<GetList xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">\n"
"<listName>%@</listName>\n"
"<QueryOptions>\n"
"<IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns>"
"<ViewAttributes Scope=\"RecursiveAll\"/>"
"</QueryOptions>\n"
"</GetList>\n"
"</soap:Body>\n"
"</soap:Envelope>\n", strListName];
[self getData];
但这又将一切归还。我是否必须编写查询才能获得我正在寻找的列表?(另外,如果你觉得大方,返回的数据不包含列表内容,而只是它的元数据/属性,就像第一次调用一样。)