public TisWebServiceClient(
     string contractType,
     ClientChannelFactoryConfiguration configuration,
     TisWebServiceContextData contextData,
     string webServiceUri)
     : this(GetVersionedType(contractType), configuration, contextData, webServiceUri)
 {
 }
 public TisWebServiceClient(
     Type contractType,
     ClientChannelFactoryConfiguration configuration,
     TisWebServiceContextData contextData,
     string webServiceUri)
     : this(contractType)
 {
     CreateWebServiceClient(contextData, configuration, webServiceUri);
 }
Esempio n. 3
0
        public void SetWebServiceCallClientContextData(
            object webServiceClientChannel,
            string stationId)
        {
            lock (this)
            {
                TisWebServiceContextData header = (TisWebServiceContextData)GetWebServiceClientHeader(webServiceClientChannel);

                if (header != null)
                {
                    header.StationId = stationId;
                }
            }
        }
Esempio n. 4
0
        private object GetWebServiceClientChannel(
            string sHostName,
            string sAppName,
            ITisWebServiceInfo oServiceInfo,
            string serviceInstanceName)
        {
            lock (this)
            {
                string webServiceUri = CreateWebServiceURI(
                    sHostName,
                    sAppName,
                    oServiceInfo.ServiceName);

                TisWebServiceClient webServiceClient =
                    GetWebServiceClientByUri(sAppName, webServiceUri);

                TisWebServiceContextData webServiceContextData = new TisWebServiceContextData()
                {
                    Name               = oServiceInfo.ServiceName,
                    ApplicationName    = sAppName,
                    InstanceName       = serviceInstanceName,
                    CreatorTypeName    = oServiceInfo.ServiceCreatorType,
                    NodeName           = Name,
                    Version            = ModuleVersion.PlatformVersion.ToString(),
                    InstancePermission = GetInstancePermission(oServiceInfo, sAppName, StationName),
                    StationName        = StationName,
                    StationId          = StationId,
                    UserName           = UserName
                };

                if (webServiceClient == null)
                {
                    m_clientChannelFactoryConfiguration.EndPointConfigurationName = GetWebServiceConfigurationName(oServiceInfo);

                    webServiceClient = new TisWebServiceClient(
                        oServiceInfo.WebServiceContractType,
                        m_clientChannelFactoryConfiguration,
                        webServiceContextData,
                        webServiceUri);

                    m_cachedWebServiceClients.TryAdd(new TisWebServiceClientInfo(sAppName, webServiceUri), webServiceClient);
                }

                webServiceClient.Header = webServiceContextData;

                return(webServiceClient.ClientChannel);
            }
        }