2829303132333435
webResource = client.resource(location + "/talk"); } @Override public Sentence greeting() { Sentence s = webResource.accept(MediaType.APPLICATION_XML).get(Sentence.class); return s; }
3435363738394041
return s; } @Override public Sentence farewell() { Sentence s = webResource.accept(MediaType.APPLICATION_XML).delete(Sentence.class); return s; }
13141516171819
public class TalkServer implements Conversation { @GET @Produces(MediaType.APPLICATION_XML) public Sentence greeting() { return new Sentence("Hello"); }
19202122232425
} @DELETE @Produces(MediaType.APPLICATION_XML) public Sentence farewell() { return new Sentence("Goodbye"); }