/// <summary>
        /// Create a new <see cref="INodeEndpointClient"/> instance for accessing and communicating with a specific Exchange node.
        /// The node is pinged after is it created to ensure it can be accessed.
        /// </summary>
        /// <param name="targetEndpointUrl">The url for the Exchange node endpoint.</param>
        /// <param name="type">The version of the Exchange node endpoint.</param>
        /// <param name="naasUserToken">A valid NAAS user token that will be used for validating this endpoint.</param>
        /// <param name="tempDirectoryPath">A local directory path used for creating temporary files during INodeEndpointClient method
        /// execution.  This value can be null, in which case the dafault system temp directory will be used.</param>
        /// <param name="proxy">Proxy information for accessing the Exchange node endpoint.  This value can be null if
        /// no proxy is required.</param>
        /// <returns>A new <see cref="INodeEndpointClient"/> instance for accessing and communicating with a specific Exchange node.  Dispose()
        /// should be called on the returned instance when the caller is finished using the instance.</returns>
        public static INodeEndpointClient CreateClientAndPing(string targetEndpointUrl, EndpointVersionType type,
                                                              string naasUserToken, string tempDirectoryPath,
                                                              IWebProxy proxy)
        {
            INodeEndpointClient client = new NodeEndpointClientFactory().Make(targetEndpointUrl, type, naasUserToken,
                                                                              tempDirectoryPath, proxy);

            try
            {
                client.NodePing();
            }
            catch (Exception)
            {
                DisposableBase.SafeDispose(client);
                throw;
            }
            return(client);
        }
 public static Exception PingNode(string targetEndpointUrl, EndpointVersionType type)
 {
     try
     {
         using (INodeEndpointClient client =
                    new NodeEndpointClientFactory().Make(targetEndpointUrl, type, new AuthenticationCredentials("test", "test"),
                                                         null, null))
         {
             client.Timeout = 8000;
             client.NodePing();
         }
         return(null);
     }
     catch (Exception e)
     {
         return(e);
     }
 }