Hi,
I'm a bit confused with the response "from" (in this example) the pdadmin user rest API call
I'm posting the following JSON command to my config instance
https://myISVAHost:port/isam/pdadmin using
{"admin_id":"sec_master", "admin_pwd":"xxxxxxxxxxxx", "commands":["user list-dn *demo 55"]}
I read the response content to a byte buffer and create a "UTF-8" string from the buffer and this is what i get:
{"result":"cmd> user list-dn *demo 55\nuid=demoeid,cn=users,...DC=SE\nuid=demoeao,cn=users,...DC=SE\nuid=demoeao2,cn=users,...DC=SE\nuid=demontmedia,cn=users,...DC=SE\nuid=demoncc,cn=users,...DC=SE\nuid=demoicn,cn=users,...DC=SE\nuid=demoalecta,cn=users,...DC=SE\nuid=demo,cn=users,...DC=SE\nuid=hrmpoldemo,cn=users,...DC=SE\nuid=demoms,cn=users,...dc=se"}
The '\' is actually the hex character '5C', an ASCII representation of the non-printable "\"??
If I bite that bullet and
replaceAll("\\x5cn", "\n") in the string, the result looks better;
{"result":"cmd> user list-dn *demo 55
uid=demoeid,cn=users,...DC=SE
uid=demoeao,cn=users,...DC=SE
uid=demoeao2,cn=users,...DC=SE
uid=demontmedia,cn=users,...DC=SE
uid=demoncc,cn=users,...DC=SE
uid=demoicn,cn=users,...DC=SE
uid=demoalecta,cn=users,...DC=SE
uid=demo,cn=users,...DC=SE
uid=hrmpoldemo,cn=users,...DC=SE
uid=demoms,cn=users,...dc=se"}
BUT -- is it really JSON??
I would expect something like below :-)
{"result":"cmd> user list-dn *demo 55",
"users":["uid=demoeid,cn=users,...DC=SE,
uid=demoeao,cn=users,...DC=SE,
uid=demoeao2,cn=users,...DC=SE,
uid=demontmedia,cn=users,...DC=SE,
uid=demoncc,cn=users,...DC=SE,
uid=demoicn,cn=users,...DC=SE,
uid=demoalecta,cn=users,...DC=SE,
uid=demo,cn=users,...DC=SE,
uid=hrmpoldemo,cn=users,...DC=SE,
uid=demoms,cn=users,...dc=se"]}
PS. I'm using Java 8 with Apache HTTP client5
Rgds & have a nice weekend...
------------------------------
Anders Domeij
CGI Sweden AB
------------------------------