*/
private Response sendMessage(Method method, RoleResource resource, String id)
throws IOException
{
XStreamRepresentation representation = new XStreamRepresentation(xstream, "", mediaType);
String roleId = (method == Method.POST) ? "" : "/" + id;
String serviceURI = "service/local/roles" + roleId;
if (method == Method.POST || method == Method.PUT) {
RoleResourceRequest userRequest = new RoleResourceRequest();
userRequest.setData(resource);
// now set the payload
representation.setPayload(userRequest);
}
return RequestFacade.sendMessage(serviceURI, method, representation);
}