Hi Tas,

This should indeed work the way you expect. I suspect a bug in the
EmfConverter, maybe it isn't picket up correctly.

Could you enter an issue in GitHub?

Thanks,
Jerome
--
http://restlet.com
http://twitter.com/#!/jlouvel






2013/2/20 Tas Frangoullides <tfrangoulli...@hotmail.com>

> Hi,
>
>
> I'm trying out Restlet and I'm particularly interested in using it with
> EMF. I've started by trying the supplied emf extensions but I can't get the
> client to work how I'd like.
>
> This is my server resource:
>
> [code]
> public interface TimeSeriesResource
> {
>     @Get
>     public TimeSeries retrieve();
>
>     @Put
>     public void update(TimeSeries timeSeries);
>
>     @Delete
>     void remove();
> }
> [/code]
>
> Where Timeseries is an EObject.
>
> On the client the following code works:
> [code]
> ClientResource cr = new ClientResource("http://localhost:8182/timeseries/1
> ");
> Representation representation = cr.get(MediaType.APPLICATION_ECORE);
> EmfRepresentation<TimeSeries> emfRed = new
> EmfRepresentation<>(representation);
> TimeSeries ts = emfRed.getObject();
> [/code]
> I'm also able to see a HTML rendered version in a web browser.
>
> However, using the EmfRepresentation seems unnecessary and I would have
> expected the following to just work:
>
> [code]
> TimeSeriesResource tsr = ClientResource.create("
> http://localhost:8182/timeseries/1";, TimeSeriesResource.class);
> TimeSeries timeSeries = tsr.retrieve();
> [/code]
>
> Instead I get this error: Unable to find a converter for this
> representation : application/octet-stream
>
> Is there something else I need to do to be able to use the client this
> way, or should I not be expecting the client to work this way?
>
> Many Thanks,
>
> Tas
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3049394
>

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

Reply via email to