protected void SetupClientInstance(ContractMapping mapping, bool isGlobal, ISkyServiceClient instance, string toHost, string fromHost) { try { DoSetupClientInstance(mapping, isGlobal, instance, toHost, fromHost); } catch (Exception error) { throw new Clients.SkyClientException(StringConsts.SKY_SVC_CLIENT_HUB_SETUP_INSTANCE_ERROR.Args(mapping, error.ToMessageWithType()), error); } }
/// <summary> /// Override to setup the instance of client after it has been allocated. /// The default implementation injects headers, timeouts, and inspectors for Glue.ClientEndPoints /// </summary> protected virtual void DoSetupClientInstance(ContractMapping mapping, bool isGlobal, ISkyServiceClient instance, string toHost, string fromHost) { var mappingData = isGlobal ? mapping.Global : mapping.Local; var tms = mappingData.CallTimeoutMs; if (tms > 0) { instance.TimeoutMs = tms; } instance.ReserveTransport = mappingData.ReserveTransport; var gep = instance as ClientEndPoint; if (gep != null) { var icfg = mappingData.Options; if (icfg != null) { MsgInspectorConfigurator.ConfigureClientInspectors(App, gep.MsgInspectors, icfg); HeaderConfigurator.ConfigureHeaders(gep.Headers, icfg); } } }