Setting COS via SOAP
I am creating accounts via soap from java. Here is my code (it works):
But I need to set the COS to the accounts and I cant do it. I tried something like this but it didnt work. Either I couldnt set firstname and lastname
Element request = Element.XMLElement.mFactory .createElement(AdminService.CREATE_ACCOUNT_REQUEST);
request.addAttribute(AdminService.E_PASSWORD, password, Element.DISP_CONTENT);
Element response = trans.invoke(request);
In soap-admin.txt file I didnt found anything about this
What can I do?
Rather than rolling your own, have you tried using the methods in SoapProvisioning.java?
Ok, I could set cos using SoapProvisioning.
Where can I get the attributtes I can put in the map?
Beacuse this example throws com.zimbra.soap.SoapFaultException: createAccount invalid attr name:
SoapProvisioning sp = new SoapProvisioning();
Map m=new HashMap();
sp.createAccount("firstname.lastname@example.org", "aaaa", m);
Look at the constants in Provisioning.java. You're dealing with standard LDAP attrs, so I believe first name is "cn" and last name is "sn"
Another good thing to do is to do the operation from the web admin client with the debug window open -- you'll see the SOAP in the debug window. I believe that you can also turn on a verbose protocol dump from zmprov.