[cosmo-dev] CMP Example and Add User

Randy Letness randy at osafoundation.org
Mon Jun 23 08:06:20 PDT 2008


Tom Jones wrote:
> Hello,
> I'm trying to add a user via CMP and I keep getting a 404 error.

Hm, 404 usually means you are using the wrong URL. For exmple, to create 
a new user "testuser" you could use the following curl command:

$ curl -u root:cosmo -T user.xml -H "Content-Type: text/xml; 
charset=utf-8" http://localhost:8080/chandler/cmp/user/testuser

assuming "user.xml" looks like:

<?xml version="1.0" encoding="utf-8" ?> 
<user xmlns="http://osafoundation.org/cosmo/CMP">
  <username>testuser</username>
  <password>abc123</password>
  <firstName>Test</firstName>
  <lastName>User</lastName>
  <email>test at user.org</email>
</user>

> I can read a user just fine 
> (http://127.0.0.1:8080/chandler/cmp/user/root). Is it possible to add 
> a user via a web browser as a test? Like this
>
> Example ...
> http://127.0.0.1:8080/chandler/cmp/user/tom1?username=tom1&password=tompass&firstname=tom&lastname=jones&email=tjones%40acworld.com 
>

This isn't supported by the current protocol. You must issue a PUT 
request with the contents being the xml representation of the new user.

-Randy


More information about the cosmo-dev mailing list