public async Task<string> SaveRole(string role) { WCFProxy.AuthorisationManagerServiceClient authorisationManagerServiceClient = null; try { authorisationManagerServiceClient = new WCFProxy.AuthorisationManagerServiceClient(new WSHttpBinding(), new EndpointAddress(endpointAddress)); var result = await authorisationManagerServiceClient.SaveRoleAsync(role).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> RemoveActivityFromActivity(string activityId, string parentId) { WCFProxy.AuthorisationManagerServiceClient authorisationManagerServiceClient = null; try { authorisationManagerServiceClient = new WCFProxy.AuthorisationManagerServiceClient(new WSHttpBinding(), new EndpointAddress(endpointAddress)); var result = await authorisationManagerServiceClient.RemoveActivityFromActivityAsync(activityId, parentId).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; } }