I have a ServerResource that uses the @Put("xml") annotation like this:

public interface TestResourceInterface {
    @Put("xml")
    public TestClass store(TestClass tc);
    ...
}

public class TestResource extends ServerResource implements 
TestResourceInterface {
    @Override
    public TestClass store(TestClass tc) {
        ....
    }
}

I have a ClientResource that then attempts to use the above ServerResource like 
this:

ClientResource cr = new ClientResource(url);
TestResourceInterface tri = cr.wrap(TestResourcEInterface.class);

tc1 = tri.store(tc2);

The ClientResource is sending a Content-Type of application/json instead of 
application/xml, so the ServerResource is returning a 405.  If I use @Put 
instead of @Put("xml"), then things work as expected.

How can I change the Content-Type of the ClientResource to application/xml?   A 
cr.getMetadataService().setDefaultMediaType(MediaType.APPLICATION_XML) doesn't 
seem to work.

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

Reply via email to