public async Task<string> SaveActivity(string activity) { WCFProxy.AuthorisationManagerServiceClient authorisationManagerServiceClient = null; try { authorisationManagerServiceClient = new WCFProxy.AuthorisationManagerServiceClient(new WSHttpBinding(), new EndpointAddress(endpointAddress)); var result = await authorisationManagerServiceClient.SaveActivityAsync(activity).ConfigureAwait(false); authorisationManagerServiceClient.Close(); return result; } catch (Exception ex) { if (authorisationManagerServiceClient != null) { authorisationManagerServiceClient.Abort(); } var serviceResponse = new ServiceResponse(ex.Message, true); var response = Serializer.SerializeToJson(serviceResponse); return response; } }
public async Task<string> RemoveRoleFromUser(string roleId, string userId) { WCFProxy.AuthorisationManagerServiceClient authorisationManagerServiceClient = null; try { authorisationManagerServiceClient = new WCFProxy.AuthorisationManagerServiceClient(new WSHttpBinding(), new EndpointAddress(endpointAddress)); var result = await authorisationManagerServiceClient.RemoveRoleFromUserAsync(roleId, userId).ConfigureAwait(false); authorisationManagerServiceClient.Close(); return result; } catch (Exception ex) { if (authorisationManagerServiceClient != null) { authorisationManagerServiceClient.Abort(); } var serviceResponse = new ServiceResponse(ex.Message, true); var response = Serializer.SerializeToJson(serviceResponse); return response; } }