private async Task <UserWSPortTypeClient> GetUserClient() { await Activate(); var endpoint = new EndpointAddress($"{BaseUrl}/User.WS"); var user = new UserWSPortTypeClient(_defaultBinding, endpoint); user.Endpoint.Behaviors.Add( new WsSecurityBehavior(new MessageInspector(new SecurityHeader("session", _sessionKey)))); await user.initializeUserWSAsync(false); return(user); }
public async Task <UserVO[]> BbCourseUsers(UserFilter filter) { _tryCount += 1; if (_tryCount == 3) { await ResetConnection(); _userClient = null; } if (_userClient == null) { _userClient = await GetUserClient(); } var userVo = await _userClient.getUserAsync(filter); _tryCount = 0; return(userVo.@return); }