AnsweredAssumed Answered

Create user using TEWS from .NET

Question asked by Aleksandar_Stancic on Nov 5, 2014
Latest reply on Dec 16, 2014 by Aleksandar_Stancic

Hi,

 

I am trying to create a new user in Identity Manager using the TEWS.

I have created proxy class using WSDL tool.

Using this class  i'm trying to create new test user in the system

 

 

            Tews6SoapBinding sb = new Tews6SoapBinding();

          

            TaskContext tc = new TaskContext();

            tc.no_namespace_on_soapfaults_header = "true";

            CreateUser cu = new CreateUser();

            tc.admin_id = "superuser";

            tc.admin_password = "P@ssw0rd";

            CreateUserProfileTab pt = new CreateUserProfileTab();

            CreateUserSearch us = new CreateUserSearch();

            us.CreateNew = true;

            pt._PCT_FIRST_NAME_PCT_= "new";

            pt._PCT_LAST_NAME_PCT_ ="User";

            pt._PCT_FULL_NAME_PCT_ = "new User";

            cu.CreateUserProfileTab = pt;

            cu.CreateUserSearch = us;

            try

            {

                ImsStatus stat = sb.CreateUser(tc, cu);

            }

            catch (Exception ex)

            {

                if (ex is System.Web.Services.Protocols.SoapException)

                {

                    System.Web.Services.Protocols.SoapException soapEx = (System.Web.Services.Protocols.SoapException)ex;

                    MessageBox.Show("\t\t" + soapEx.Detail.OuterXml);

                }

            }

 

 

but when i execute this code i get the error from the server

 

<![CDATA[TEWS task exec error: Too many objects returned by search for task: Create User ]]>

 

can anyone help me with this or send me the example of create or modify user from .NET code

Outcomes