public void EditItem( string oldPath, string newPath, string description) { Property[] rsProperties = this.CreateDescriptionProperty(description); try { //Rename Item and Create new Properties based on old properties //Create batch header BatchHeader singleBatchHeader = new BatchHeader(); //Set EditItem batch id and top BatchHeaderValue singleBatchHeader.BatchID = this.RSWebService.CreateBatch(); this.RSWebService.BatchHeaderValue = singleBatchHeader; //Call methods to batch this.RSWebService.MoveItem(oldPath, newPath); this.RSWebService.SetProperties(newPath, rsProperties); //Test code. // this.SetProperties( newPath, null ); causes a failed method call which results in // a rollback of the MoveItem changes //Rollback transaction if either method fails this.RSWebService.ExecuteBatch(); this.RSWebService.BatchHeaderValue = null; } catch (SoapException) { //BatchOperationFailed throw new Exception(string.Format(CultureInfo.InvariantCulture, Resources.Resources.BatchOperationFailed)); } }
public void DeleteItems(string path, ArrayList catalogItems) { string itemPath; //Create batch header BatchHeader singleBatchHeader = new BatchHeader(); //Set EditItem batch id and top BatchHeaderValue singleBatchHeader.BatchID = this.RSWebService.CreateBatch(); this.RSWebService.BatchHeaderValue = singleBatchHeader; //Call DeleteItem methods foreach(string item in catalogItems) { itemPath = this.GetCleanPath(path, item); this.DeleteItem( itemPath ); } //Execute DeleteItem methods in a batch this.RSWebService.ExecuteBatch(); this.RSWebService.BatchHeaderValue = null; }