예제 #1
0
        /// <summary>
        /// Create a web service client.
        /// </summary>
        /// <returns>A web service client.</returns>
        protected override Object CreateClient()
        {
            ArtsnavnebaseSoapClient client;

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

            return(client);
        }
예제 #2
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(NorwayTaxonServiceProxy webService,
                    Int32 operationTimeoutMinutes,
                    Int32 operationTimeoutSeconds = 0)
 {
     _operationTimeout = (operationTimeoutMinutes * 60) + operationTimeoutSeconds;
     _webService       = webService;
     _client           = (ArtsnavnebaseSoapClient)(_webService.PopClient(_operationTimeout));
     _webService.SetTimeout(Client.Endpoint.Binding, _operationTimeout);
 }
예제 #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;
 }