Create Workspace using IWOV services

I have tried creating new workspace using IWOV services.I am able to set all the new workspace properties by using CreateWorkSpacesInput but I am not getting any response by CreateWorkSpacesOutput. Hence, workspace is not created.

 

Please help !

Comments

  • Ok, suggest turning on Middleware logging on the Web server so you can see if this outputs any errors.
    Have you tried setting the same paremeters using the sample app?

     

  • Hi,

     

    I dont have the sample app.I set the parameters by myslef.

    Could you please give me the sample app !!!

     

    Thanks !

  • The samples are in the WorkSite\Web\Samples folder of the worksite Web folder.  This would match the version you have installed, rather than the version I've got.
    There's also documenation as part of the SDK, although it's a few years out of date.

  • Hi,

     

    I dont have access to WorkSite\Web\Samples folder.Could you tell me the complete path.

     

    Please share the sample code for creating workspace of whatever version you have.

     

    Thanks!

  • it's dependant on where worksite web hass been installed, but by default it would be in C:\Program Files\Autonomy\WorkSite\Web\Samples.

    I've attached WSW 9 Update 3's samples

     

  • Thanks for the help !

     

    Now WorkSpace is successfully created refering the sample code but each time it showing the WorkSpace Profile Error.

     

    I am setting Profile and Output Profile parameter to imProfileName as AttributeID and WorkSpace name as value.I guess these parameters are the source of error.

     

    Please help how to remove this error!

  • Hi,

    Can you post your code? I'm not sure what the problem is

    Here's the creation code from the sample:

     

    CreateWorkspacesInput input = new CreateWorkspacesInput();

     

    input.DestinationDatabase = txtCreateWorkspaceDb.Text;

     

    input.Workspaces = workspaces;

     

    input.OutputProfile = outPutProfile;

     

    input.OutputMask = ServicesClientUtility.GetWorkspaceOutputMask(true, true, true, true, true);

     

    CreateWorkspacesOutput output = connection.IWOVServices.CreateWorkspaces(input);

     

    txtCreateWkspcOutput.Text = ServicesClientUtility.GetWorkspaceOperationOutputString(output.Workspaces, output.Errors);

     

  • That code is same.I am asking for parameter values.I paasssed the following but getting error.Please tell me the parameter values to be passed:

     

     

     

    IWOVService WSWSvcs = new IWOVServices();

     

    // Attempt to authenticate

    WSWSvcs.PreAuthenticate =

    true;

    WSWSvcs.AllowAutoRedirect =

    true;

    WSWSvcs.Credentials = System.Net.

    CredentialCache.DefaultCredentials;

     

    ProfileItem[] profile = ServiceClientUtility.ConvertProfile("imProfileName,Hieee");

     

    imProfileAttributeID[] outPutProfile = ServiceClientUtility.ConvertProfileMask("imProfileName,Hieee");

     

    ObjectSecurity security = ServiceClientUtility.ConvertSecurity("Group, DOMAIN USERS, imRightReadWrite", "imPrivate", false);

     

    CustomProperty[] customProperties = ServiceClientUtility.ConvertCustomProps("imFolderCustom1,custom1\nimFolderCustom2,custom2\nimFolderCustom3,custom3");

     

    AdditionalProperty[] additionalProperties = ServiceClientUtility.ConvertAdditionalProps("");

     

     

     

    Notification notification = new Notification();

    notification.Subject =

    "";

    notification.Message =

    "Created from Web Service 2";

    notification.Recipients =

    ServiceClientUtility.ConvertRecipients("User,imgtservice");

     

     

    NewWorkspace[] workspaces = new NewWorkspace[1];

    workspaces[0] =

    new NewWorkspace();

     

    workspaces[0].Name =

    "Hieee";

    workspaces[0].Description =

    "Created from Web Service Description 1";

    workspaces[0].Category =

    "Programs";

    workspaces[0].Notification = notification;

    workspaces[0].Profile = profile;

    workspaces[0].Security = security;

     

    workspaces[0].CustomProperties = customProperties;

    workspaces[0].AdditionalProperties = additionalProperties;

     

    CreateWorkspacesInput input = new CreateWorkspacesInput();

    input.DestinationDatabase ="CaseManagement";

    input.Workspaces = workspaces;

    input.OutputProfile = outPutProfile;

    input.OutputMask = GetWorkspaceOutputMask(

    true, true, true, true, true);

     

    CreateWorkspacesOutput output =WSWSvcs.CreateWorkspaces(input);

    TextBox1.Text = GetWorkspaceOperationOutputString(output.Workspaces, output.Errors);

     

  • I'm guessing it's the problem, the outputmask is a bitmask, not a array of profile fields.
    from the documentation:

     

    To set the value of the OutputMask in the input message, select the properties you want the Web service to return in the output message and add the enumerated values. For example, to include Profile (1), Security (2), DocumentContent (4), and History (8), set the value (1 + 2 + 4 + 8) = 15.

     

     

     

    [Flags]

    public enum OutputMask

    {

    Profile = 1,

    Security = 2,

    DocumentContent = 4,

    History = 8,

    CustomProperties = 16,

    AdditionalProperties = 32,

    SubFolders = 64,

    FolderContent = 128

    }

     

    Hope this helps

     

  • No, its not a problem of OutputMask.It is the problem of setting the value of profile and outputProfile parameters:

     

     

    ProfileItem

    [] profile = ServiceClientUtility.ConvertProfile("imProfileName,Hieee");

     

    imProfileAttributeID[] outPutProfile = ServiceClientUtility.ConvertProfileMask("imProfileName,Hieee");

     

     

    Please confirm the values passed.

  • It should be a list of imProfileAttributes, not values, try:

    imProfileAttributeID[] outPutProfile = ServiceClientUtility.ConvertProfileMask("imProfileName");

  • I tried this, but then also it is giving the same WorkSpace profile error.

     

    Please suggest any other solution !

  • Below method creates workspace and returns workspaceOutput.     

     

      public CreateWorkspacesOutput CreateWorkspace(string accessSecurity, string wName, string wDatabase, string wCustom6, string wCustom8, string wCustom10, string wCustom11, string wCustom29, string wCustom30, string wTempID, Connection conn)
            {
                ProfileItem[] profile = ServicesClientUtility.ConvertProfile("imProfileCustom29," + wCustom29 + "\nimProfileCustom30," + wCustom30 + "\nimProfileCustom10," + wCustom10 + "\nimProfileCustom6," + wCustom6 + "\nimProfileCustom11," + wCustom11 + "\nimProfileCustom8," + wCustom8);
                iManage.WorkSite.Web.ServicesProxy.IWOVService.imProfileAttributeID[] outPutProfile = ServicesClientUtility.ConvertProfileMask("imProfileCustom29," + wCustom29 + "\nimProfileCustom30," + wCustom30 + "\nimProfileCustom10," + wCustom10 + "\nimProfileCustom6," + wCustom6 + "\nimProfileCustom11," + wCustom11 + "\nimProfileCustom8," + wCustom8);
                //CustomProperty[] customProperties = ServicesClientUtility.ConvertCustomProps("imFolderCustom1," + wCustom1);

                ObjectSecurity security = ServicesClientUtility.ConvertSecurity(accessSecurity, "imPrivate", true);

                NewWorkspace[] workspaces = new NewWorkspace[1];
                workspaces[0] = new NewWorkspace();
                workspaces[0].Name = wName + " (" + wCustom6 + ")";
                workspaces[0].Description = wCustom6;
                workspaces[0].TemplateID = wTempID;
                workspaces[0].Profile = profile;
                workspaces[0].Security = security;
                workspaces[0].SubType = "Work";

                CreateWorkspacesInput input = new CreateWorkspacesInput();
                input.DestinationDatabase = wDatabase;
                input.Workspaces = workspaces;
                input.OutputProfile = outPutProfile;
                input.OutputMask = ServicesClientUtility.GetWorkspaceOutputMask(true, true, false, false, true);
                CreateWorkspacesOutput output = conn.IWOVServices.CreateWorkspaces(input);
                return output;
            }

TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs