You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/06/05 17:40:21 UTC

[jira] [Commented] (SYNCOPE-389) REST api not working as expected

    [ https://issues.apache.org/jira/browse/SYNCOPE-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13676041#comment-13676041 ] 

Sergey Beryozkin commented on SYNCOPE-389:
------------------------------------------

Hi All, just a side note, may be a Long parameter can be replaced with String on the server side, so that the custom code can validate and throw a more user-centric exception in cases where a non-number parameter gets in somehow; though what we can also do is to either use a reg-ex path expression limiting the value of user id to digits or wait till CXF integrates with Bean Validation API
                
> REST api not working as expected
> --------------------------------
>
>                 Key: SYNCOPE-389
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-389
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.1
>         Environment: glassfish
>            Reporter: Nik Tetteh-Lartey
>            Priority: Critical
>         Attachments: exception.trace, nik.role, wholeuser.xml
>
>
> I try to update a user using REST (curl) and core throws an exception and error 500:
> a) background I added a role to a user
> b) I retrieved the data from that user with a get (see attached file wholeuser.xml) and removed
> the roleID and RoleName (this should mean I remove role from user when I POST the data) as per REST api wiki doc.
> c) When I use the modified xml to update the user (see attached /tmp/nik.role) an exception is thrown.
> [nik@anvil idmRBAC]$ curl -u admin:password -H "Content-Type: application/json" -X POST http://10.0.0.183:9090/syncope/cxf/users/{nik} -d @/tmp/nik.role  -D /tmp/out
> [nik@anvil idmRBAC]$ cat !$
> cat /tmp/out
> HTTP/1.1 100 Continue
> HTTP/1.1 500 Internal Server Error
> X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.2 Java/Sun Microsystems Inc./1.6)
> Server: GlassFish Server Open Source Edition 3.1.2
> Date: Wed, 05 Jun 2013 15:07:40 GMT
> Content-Length: 0
> Connection: close
> [nik@anvil idmRBAC]$ 
> see attached file for exception (exception.trace)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira