on 07-27-2010 7:30 PM
Below is the .net code i am using to try to create an MDM user. On the cmd.execute(); I get this error below.
Does the code look correct? Any ideas on the error?
Also, of note, UserId uid = cmd.getNewUserId(); returns null, so I'm not setting it.
ERROR:
InnerException: com.sap.mdm.intern.protocol.manual.ServerException
Message="MDM repository data is out-of-date or is locked by another MDM Server. Refresh the data and try the operation again. If the error persists, contact the system administrator. [0xffab4128]"
Source="MdmDotNetApi"
ErrorCode=-5553880
StackTrace:
at com.sap.mdm.intern.protocol.manual.AbstractProtocolCommand.execute(PassportSupport passportSupport)
at com.sap.mdm.security.commands.CreateUserCommand.execute()
CODE:
RepositorySessionContext repSessionCtx = new RepositorySessionContext("SERVER", "REPOSITORY", "USERID");
UserSessionContext UserSessionCtx = new UserSessionContext("SERVER", "REPOSITORY", "USERID");
UserSessionCtx.ApplicationName = "APPLICATION";
string repsessiontext = SessionManager.Instance.createSession(repSessionCtx, SessionTypes.REPOSITORY_SESSION_TYPE, "PASSWORD");
CreateUserCommand cmd = new CreateUserCommand(repSessionCtx);
cmd.Session = repsessiontext;
cmd.User = new UserProperties();
UserId uid = cmd.getNewUserId();
//cmd.User.Id = uid;
cmd.User.Description = "Test";
cmd.User.Emails = new String[1] {"TestATtest.com"};
cmd.User.FullName = "TEST TEST";
cmd.User.Locked = false;
cmd.User.Name = "TEST";
cmd.User.PasswordChangeRequired = false;
cmd.User.PasswordNeverExpires = true;
cmd.User.setPassword("asdf1234!@#$");
cmd.InChangeStamp = -1;
cmd.execute();
Edited by: Wardell Castles on Jul 27, 2010 5:44 PM - was missing this line 'cmd.Session = repsessiontext;'
Hi,
I think the problem is with...
cmd.InChangeStamp = -1;
Try doing this...
GetUserListCommand userListCmd = new GetUserListCommand(repSessionCtx);
userListCmd.execute();
cmd.InChangeStamp = userListCmd.InChangeStamp;
Hope this will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Wardell
Also, of note, UserId uid = cmd.getNewUserId(); returns null, so I'm not setting it.
After CreateUserCommand is executed successfully, it returns the new userID. So before executing the command it will return only NULL.
In your case you are trying to get the value before calling the execute method of CreateUserCommand.
Also the exception message says "MDM repository data is out-of-date or is locked by another MDM Server"
Can you reload once your repository and if possible restart the MDM server(a wild guess to check if it is not locked) and let me know if it works?
Regards
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.