Exemplo n.º 1
0
        public ServiceHttpProxy getOpenHttpProxy()
        {
            if (null == _host)
            {
                BaseException e = new BaseException(this, "null == _host");
                throw e;
            }

            if (null != _openHttpProxy)
            {
                return _openHttpProxy;
            }

            NetworkAddress networkAddress = new NetworkAddress(_host, _port);
            HttpDispatcher httpDispatcher = new HttpDispatcher(networkAddress);
            _openHttpProxy = new ServiceHttpProxy(httpDispatcher);

            return _openHttpProxy;
        }
 public ServiceHttpProxy(HttpDispatcher httpDispatcher)
 {
     _httpDispatcher = httpDispatcher;
     _responseHandler = new BrokerMessageResponseHandler();
 }
 public ServiceHttpProxy(HttpDispatcher httpDispatcher, Authenticator authenticator)
 {
     _httpDispatcher = httpDispatcher;
     _authenticator = authenticator;
     _responseHandler = new BrokerMessageResponseHandler();
 }
        private ServiceHttpProxy buildServiceHttpProxy(bool useAuthService)
        {
            Authenticator authenticator = null;

            if (useAuthService)
            {

                SecurityConfiguration securityConfiguration = SecurityConfiguration.TEST;
                authenticator = new Authenticator(false, securityConfiguration);


            }

            HttpDispatcher httpDispatcher = new HttpDispatcher(_networkAddress);

            ServiceHttpProxy answer = new ServiceHttpProxy(httpDispatcher, authenticator);
            return answer;

        }
Exemplo n.º 5
0
        public ServiceHttpProxy getAuthHttpProxy(ClientSecurityConfiguration clientSecurityConfiguration)
        {
            if (null == _host)
            {
                BaseException e = new BaseException(this, "null == _host");
                throw e;
            }

            if (null != _authHttpProxy && _authHttpProxy.Authenticator.getSecurityConfiguration() == clientSecurityConfiguration)
            {
                return _authHttpProxy;
            }

            NetworkAddress networkAddress = new NetworkAddress(_host, _port);
            HttpDispatcher httpDispatcher = new HttpDispatcher(networkAddress);
            Authenticator authenticator = new Authenticator(false, clientSecurityConfiguration);
            _authHttpProxy = new ServiceHttpProxy(httpDispatcher, authenticator);

            return _authHttpProxy;
        }