FYI, see follow-up here:
http://stackoverflow.com/questions/14409575/unsupported-media-type-415-with-generic-put-or-post

Jerome


2013/1/18 Darwin Airola <[email protected]>

> Aloha!
>
> I was trying to implement a generic put or post method in Restlet. (I was
> able to implement a generic Get method without issue.)
>
> Here is the relevant portion of my server resource (interface) file:
>
> @Post
> public <T> void insert( T object ) ;   //  non-idempotent update/create
>
>
> Here is the relevant portion of my server resource (implementation) file:
>
> //  non-idempotent create/update
> public <T> void insert( T object )
> { }
>
>
> I have tried both of the following in my Restlet client:
>
> clientResource.insert( newUser ) ;
> clientResource.<User>insert( newUser ) ;
>
>
> However, both of these result in the following client side exception:
>
> Exception in thread "main" Unsupported Media Type (415) - Unsupported
> Media Type
>  at org.restlet.resource.ClientResource.doError(ClientResource.java:612)
> at
> org.restlet.engine.resource.ClientInvocationHandler.invoke(ClientInvocationHandler.java:264)
>  at $Proxy8.store(Unknown Source)
> at storage.client.Client.main(Client.java:53)
>
>
> Thus, it appears that there is some sort of marshaling (to the actual
> server put method -- insert()) that is failing.
>
> Does anyone know how to resolve this problem?
>
> Take care,
> Darwin
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3046403

Reply via email to