Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API: AddUser

16 REPLIES 16
Reply
Message 1 of 17
Anonymous
473 Views, 16 Replies

API: AddUser

How does the API AddUser command work? It's asking for roleIDArray, VaultIdArray and licenseIdArray in the function. How would I use this if I simply want to assign no roles, vaults, etc to the user at time of creation?

Any sample code?
16 REPLIES 16
Message 2 of 17
Anonymous
in reply to: Anonymous

You can pass in null (Nothing in VB) for the roles, vaults, and licenses.


Doug Redmond
Software Engineer, Autodesk Vault
Message 3 of 17
Anonymous
in reply to: Anonymous

I keep getting this error:

System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://AutodeskDM/Services/AdminService/01/02/2007/AddUser.
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)


It looks like I might have the admin service setup incorectly. Is there some code to check against?
Message 4 of 17
Anonymous
in reply to: Anonymous

The error indicates that your client code doesn't match the server version.
It appears that your client is set for the Vault or Productstream 2008
release. Are you trying to connect to a Vault 5 or Vault 2009 Beta server?

To fix the problem you need to sync your client to the correct version. You
can do this by opening your project in Visual Studio, updating the URL for
your web service to point to a server running the correct version, and
running the "Update Web Service" command. These steps have to be done for
each web service in your project.

For more information, see the "Different Versions" page of the Knowledge
Base in the API docs.


Doug Redmond
Software Engineer, Autodesk Inc.
Message 5 of 17
Anonymous
in reply to: Anonymous

I'm not sure this is the issue, I started with the sample from the 2008 SDK, "VaultList" and modified it.

The sample works ok but my new code fails. I saw in the error the URL is "http://AutodeskDM/Services/AdminService/01/02/2007/AddUser." I believe it should start... "http://localhost/AutodeskDM/..."

This is my code:
Dim adminSrv As Admin.AdminService = New Admin.AdminService
adminSrv.SecurityHeaderValue = New VaultList.Admin.SecurityHeader
adminSrv.SecurityHeaderValue.UserId = adminSrv.SecurityHeaderValue.UserId
adminSrv.SecurityHeaderValue.Ticket = adminSrv.SecurityHeaderValue.Ticket
adminSrv.Url = "http://localhost/AutodeskDM/Services/DocumentService.asmx"
Message 6 of 17
Anonymous
in reply to: Anonymous

The "URL" in the error always has the form http://AutodeskDM/... I'm not
sure why.

Anyway, the problem with your code is that you set adminSrv.Url to point at
DocumentService.asmx. It needs to point to AdminService.asmx.


Doug Redmond
Software Engineer, Autodesk Inc.
Message 7 of 17
Anonymous
in reply to: Anonymous

Ouch...

Thanks for the help, I got it
Message 8 of 17
Anonymous
in reply to: Anonymous

I got the code to work but it doesn't allow me to pass nothing to the the roleIDarray or vaultIDarray, it flags an 133 error code or 214 error code.
Message 9 of 17
Anonymous
in reply to: Anonymous

Hmm... that might be a bug. I'll look into it.
In the meantime, pass in empty arrays instead. That should also result in a
user with no roles or Vaults.


Thanks,
Doug Redmond
Software Engineer, Autodesk Inc.
Message 10 of 17
Anonymous
in reply to: Anonymous

I tried that... no luck. I have to assign a value to the array.
Message 11 of 17
Anonymous
in reply to: Anonymous

I ran a quick test, and everything worked for me when I passed in Nothing
for the array values.

Dim newUser As User = adminSvc.AddUser("VBTest1", "", "", "", "", True,
Nothing, Nothing, Nothing)


Doug Redmond
Software Engineer, Autodesk Inc.
Message 12 of 17
Anonymous
in reply to: Anonymous

Seems to work ok now, I had some other sloppy code that was messing things up.
Message 13 of 17
simonsson
in reply to: Anonymous

I have this problem aswell. It seems I cant pass in null for roles and vaults.

This is C# and Vault 2010 API.

admSvc.AddUser(“TestUser”, “pwd”, VaultConnection.VaultAdminService.AuthType.Vault, “name”, “lastname”, “email@email.com“, true, null, null);

I get soap exception 155:
155 | IllegalNullParam | A null value was passed in where a null value is not allowed.

Any idea what I'm doing wrong? I want to set administrator role and check all vaults.

Thanks
Message 14 of 17
Anonymous
in reply to: Anonymous


I just ran a test in Vault 2010, and passing in
null still works for roleIdArray and
size=3>vaultIdArray. 

 

Looking at the code from your post,
face="Times New Roman" size=3>the 'atype' parameter looks wrong.  It should
be AuthTyp, with no 'e' at the end.  Did you copy and paste directly from
your source code?  Is there a chance that any of the other parameters could
have a null value?


face=Arial size=2>

--
Doug
Redmond
Software Engineer, Autodesk Inc.

href="http://justonesandzeros.typepad.com/">
size=2>http://justonesandzeros.typepad.com/
Message 15 of 17
simonsson
in reply to: Anonymous

You're right! The user name was null for some other reason. I just didn't realize that.

Thanks!
Message 16 of 17
simonsson
in reply to: Anonymous

How do I set the added user to be a member of all vaults?
Message 17 of 17
Anonymous
in reply to: Anonymous

Call GetAllKnowledgeVaults in the Knowledge Vault Service to get a list of
all the vaults.
Call AddUser in the Admin Service to create a new user with the proper Vault
membership.
Call UpdateUserInfo in the Admin Service to update the Vault membership of
an existing user.

--
Doug Redmond
Software Engineer, Autodesk Inc.
http://justonesandzeros.typepad.com/

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report