就是我从服务器上的moss平台上取下的数据,假如是一条新闻,怎么修改他,然后保存到服务器。
下面是我的修改代码- (NSString *)editUpdateListItems {NSString *scString = [NSString stringWithFormat:@"<Batch><Method ID='1' Cmd='Update'>" \
"<Field Name='ID'>%@</Field>"
"<Field Name='BaseName'>%@</Field></Method></Batch>"
,
[tableDictionary objectForKey:@"ows_ID"],
[tableDictionary objectForKey:@"ows_Title"]
];
NSString *xmlString = [NSString stringWithFormat:@"<UpdateListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"> \
<listName>%@</listName> \
<updates>%@</updates> \
</UpdateListItems>",
[dataDicts objectForKey:@"InternalName"], scString
];
//InternalName
return xmlString;
}
下面是我的修改代码- (NSString *)editUpdateListItems {NSString *scString = [NSString stringWithFormat:@"<Batch><Method ID='1' Cmd='Update'>" \
"<Field Name='ID'>%@</Field>"
"<Field Name='BaseName'>%@</Field></Method></Batch>"
,
[tableDictionary objectForKey:@"ows_ID"],
[tableDictionary objectForKey:@"ows_Title"]
];
NSString *xmlString = [NSString stringWithFormat:@"<UpdateListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"> \
<listName>%@</listName> \
<updates>%@</updates> \
</UpdateListItems>",
[dataDicts objectForKey:@"InternalName"], scString
];
//InternalName
return xmlString;
}
你得找找服务器程序的负责人了。
- (void)saveButtonClick1 :(id)sender {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
NSString *xmlString = @"";
switch ( navType ) {
case ZYListItemNavTypeAdd1:
{
xmlString = [self addUpdateListItems];
break;
}
case ZYListItemNavTypeEdit1:
{
xmlString = [self editUpdateListItems];
break;
}
default:
break;
}
ZYNetworkConnection *network = [[ZYNetworkConnection alloc] init];
[network UpdateListItems:xmlString And:self];
self.navigationItem.rightBarButtonItem = BARBUTTON(ZY_STRING_MENU, @selector(menuButtonClick:));
navType = ZYListItemNavTypeNone1;
[self.tableView reloadData];
[network release];
} [network UpdateListItems:xmlString And:self];
是调用另一个- (void)UpdateListItems:(NSString *)xml And:(id)ctl{
[self setConnection:@"lists.asmx" AndXml:xml AndSoap:@"UpdateListItems" And:ctl];
}