示例#1
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;
            }
示例#2
0
        /// <summary>
        /// Create a web service client.
        /// </summary>
        /// <returns>A web service client.</returns>
        protected override Object CreateClient()
        {
            SpeciesObservationHarvestServiceClient client;

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

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

            return(client);
        }