/// <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;
 }
        /// <summary>
        /// Create a web service client.
        /// </summary>
        /// <returns>A web service client.</returns>
        protected override Object CreateClient()
        {
            SwedishSpeciesObservationSOAPServiceClient client;

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

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

            return(client);
        }