public ServerProxyWithoutChunking(string serverUri, ICredentials credentials, IAsyncWorker worker) { IsAuthorized = true; VerifyArgument.IsNotNull("serverUri", serverUri); ServerEvents = EventPublishers.Studio; var uriString = serverUri; if (!serverUri.EndsWith("dsf")) { uriString = serverUri + (serverUri.EndsWith("/") ? "" : "/") + "dsf"; } Principal = ClaimsPrincipal.Current; AppServerUri = new Uri(uriString); WebServerUri = new Uri(uriString.Replace("/dsf", "")); Dev2Logger.Debug(credentials); Dev2Logger.Debug("***** Attempting Server Hub : " + uriString + " -> " + CredentialCache.DefaultNetworkCredentials.Domain + @"\" + Principal.Identity.Name); HubConnection = new HubConnectionWrapper(uriString) { Credentials = credentials }; HubConnection.Error += OnHubConnectionError; HubConnection.Closed += HubConnectionOnClosed; HubConnection.StateChanged += HubConnectionStateChanged; InitializeEsbProxy(); AsyncWorker = worker; }
public ServerProxy(string serverUri, ICredentials credentials) { IsAuthorized = true; var uriString = serverUri; if (!serverUri.EndsWith("dsf")) { uriString = serverUri + (serverUri.EndsWith("/") ? "" : "/") + "dsf"; } AppServerUri = new Uri(uriString); WebServerUri = new Uri(uriString.Replace("/dsf", "")); Credentials = credentials; try { HubConnection = new HubConnectionWrapper(uriString) { Credentials = credentials };; HubConnection.Error += OnHubConnectionError; HubConnection.Closed += HubConnectionOnClosed; HubConnection.StateChanged += HubConnectionStateChanged; //HubConnection.TraceLevel = TraceLevels.All; //HubConnection.TraceWriter = new Dev2LoggingTextWriter(); InitializeEsbProxy(); } catch (Exception err) { HubConnection = new Dev2.SignalR.Wrappers.Old.HubConnectionWrapperOld(uriString) { Credentials = credentials };; HubConnection.Error += OnHubConnectionError; HubConnection.Closed += HubConnectionOnClosed; HubConnection.StateChanged += HubConnectionStateChanged; //HubConnection.TraceLevel = TraceLevels.All; //HubConnection.TraceWriter = new Dev2LoggingTextWriter(); InitializeEsbProxy(); } }