示例#1
0
 /// <summary>
 /// Constructor for the ClientProxy class.
 /// Allocates an instance of the real web service client.
 /// </summary>
 /// <param name="webService">Web service proxy.</param>
 /// <param name="operationTimeoutMinutes">Operation timeout to set in the client. Unit is minutes.</param>
 /// <param name="operationTimeoutSeconds">Operation timeout to set in the client. Unit is seconds.</param>
 public ClientProxy(SersServiceProxy webService,
                    Int32 operationTimeoutMinutes,
                    Int32 operationTimeoutSeconds = 0)
 {
     _operationTimeout = (operationTimeoutMinutes * 60) + operationTimeoutSeconds;
     _webService       = webService;
     _client           = (SpeciesObservationChangeServiceClient)(_webService.PopClient(_operationTimeout));
     _webService.SetTimeout(Client.Endpoint.Binding, _operationTimeout);
 }
示例#2
0
        /// <summary>
        /// Create a web service client.
        /// </summary>
        /// <returns>A web service client.</returns>
        protected override Object CreateClient()
        {
            SpeciesObservationChangeServiceClient client;

            client = new SpeciesObservationChangeServiceClient(GetBinding(), GetEndpointAddress());

            // Increase data size for all methods that
            // sends or receives a lot of data.
            IncreaseDataSize("GetSpeciesObservationChangeAsSpecies", client.Endpoint);

            return(client);
        }
示例#3
0
 /// <summary>
 /// Implementation of the IDisposable interface.
 /// Recycle the client instance.
 /// </summary>
 public void Dispose()
 {
     if ((_client.State != CommunicationState.Opened) ||
         (!_webService.PushClient(_client, _operationTimeout)))
     {
         // Client is not in state open or
         // was not added to the client pool.
         // Release resources.
         _client.Close();
     }
     _client = null;
 }