我得到的錯誤,而使用核心服務錯誤而使用的核心服務
根元素必須是在命名空間外表套上更新組件更新組件在外表套上
我的代碼:
ComponentData component = client.Read(webDavPath, readOptions) as ComponentData;
component = client.TryCheckOut(webDavPath, readOptions) as ComponentData;
//XDocument dom = XDocument.Parse(component.Content);
//// do your modifications to dom
//component.Content = dom.ToString();
doc.Load(filePath);
sw = new StringWriter();
xw = new XmlTextWriter(sw);
doc.WriteTo(xw);
component.Content = sw.ToString();
//client.CheckOut(webDavPath, true, readOptions);
client.Update(component, readOptions);
client.Save(component, readOptions);
client.CheckIn(component.Id, readOptions);
//client.Update(component, new ReadOptions());
// component = client.Update(component, readOptions) as ComponentData;