Getting Domains From Workflow Management Server

  • 12 June 2012
  • 3 replies
  • 0 views

Badge +6

I am trying to get a list of domains from the Workflow Management server.  When I execute the code below:


 


 using (WindowsImpersonationContext impersonationContext = (User.Identity as WindowsIdentity).Impersonate())
            {


                SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder builder =
                new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();


 


                builder.Authenticate = true;
                builder.Host = "localhost";
                builder.Port = 5555;
                builder.Integrated = true;
                builder.IsPrimaryLogin = true;


                SourceCode.Workflow.Management.WorkflowManagementServer workflowManagementServer = new SourceCode.Workflow.Management.WorkflowManagementServer();
                workflowManagementServer.CreateConnection();
                workflowManagementServer.Open(builder.ToString());
                Domains d = workflowManagementServer.GetDomains();
                impersonationContext.Undo();


            }


 


I get the following error message:


Could not find stored procedure 'Server.mGetDomains'


Has anyone run into this issue before?


 


3 replies

Badge +6

This is a Bug. Please log a support ticket.


What is the requirement for getting list of domains? May be I can suggest a workaround

Badge +6

When a user logs into our app, the user is required to prefix the user name with a domain.  My goal was to populate a dropdown menu with a list of domains from the K2 Workflowmanagement server (I currenly have two, and may be adding more). The bug is not a deal-breaker, as since there are only two domains, so I can always just hard-code them.  I'll log a support ticket, though.

Badge +6

In that case, you can use "AD Service2" smartobject. use "AD User...GetUsers" method to find the domain of the logged in user and you can actually append the domain to the username without user intervention. If you get more than one result from the smartobject(i.e., same username exists in more than one domain), then you can give the choice to the user to select the correct domain.

Reply