cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a user via WS

lmorgan
Champ in-the-making
Champ in-the-making
I am trying to add a user via the Web Service and getting an Axis fault:


2006-03-09 20:55:05,950 [exec_Maven_4] FATAL com.mahoganyunion.cm.dao.SecurityDAOImpl - Error adding user to the CMR
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
        {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Premature end of file.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

Here is my code snippet:



        NewUserDetails newRepositoryUser = new NewUserDetails();
        newRepositoryUser.setPassword(_newuser.getPassword());
        newRepositoryUser.setUserName(_newuser.getUsername());
       
        // Save the User to the CMR
        try {
            UserDetails [ ] results = WebServiceFactory.getAdministrationService().createUsers(new NewUserDetails[ ]{newRepositoryUser});
                       
            if (logger.isInfoEnabled()) {
                logger.info("User [" + _newuser.getFullName() + "] added to the CMR");
            }
        }
        catch (Exception e) {
            logger.fatal("Error adding user to the CMR", e);
        }

I suspect I may need to add properties (i.e. NamedValues), but not sure which ones are required. My env is: Tomcat Bundle, Alfresco 1.2

Thanks in advance,
Lonnie
1 REPLY 1

lmorgan
Champ in-the-making
Champ in-the-making
Smiley Sad

Should have done this before posting. If anyone else comes looking try the test file in the source code:

projects/web-service-client/source/java/org/alfresco/webservice/test/AdministrationServiceSystemTest.java