I'm writing a web service that I'm hoping to use in conjunction with Workflow Designer.
The desired outcome is to input a doc id in the workflow, along with other necessary parameters, and have the document automatically merge the layers.
However, I can't figure out how to actually get the merge to happen. I believe that I need section numbers for the document, but I'm not sure where to go from here. Here's my code so far:
- public string mergeLayers(string uri, string userName, string passWord, string DWDocID, string fileCabinetName)
- {
- var message = "";
- try
- {
- ServiceConnection sc = ConnectToDocuWare(uri, userName, passWord);
- message = "Connected";
- var org = sc.Organizations[0];
- var fileCabinets = org.GetFileCabinetsFromFilecabinetsRelation().FileCabinet;
- var fileCabinet = fileCabinets.Where(f => f.Name == fileCabinetName).FirstOrDefault();
- var dialogInfoItems = fileCabinet.GetDialogInfosFromSearchesRelation();
- var dialog = dialogInfoItems.Dialog[0].GetDialogFromSelfRelation();
- var result = RunQuery(dialog, DWDocID);
- var doc = getDoc(result, dialog, DWDocID);
- var sections = doc.Sections;
- try
- {
- message = "trying merge";
- foreach (var s in sections)
- {
- new MergeAnnotationsParameters()
- {
- SectionNumber = int.Parse(s.Id)
- };
- message = "success";
-
- }
- }
- catch (Exception ex)
- {
- message = ex.ToString();
- }
- }
- catch (Exception ex)
- {
- message = ex.ToString();
- }
- return message;
- }