/// <summary>
        ///     Allows connection to a HotDocs Web API
        /// </summary>
        /// <param name="hostAddress">The address of the Web API</param>
        /// <param name="retrieveFromHub">
        ///     Indicates if the template is stored in a Template Hub and if the package ID used is a
        ///     Version ID or Template ID
        /// </param>
        public HotDocsService(string hostAddress, RetrieveFromHub retrieveFromHub = RetrieveFromHub.No)
        {
            if (string.IsNullOrEmpty(hostAddress))
            {
                throw new ArgumentException("Host address cannot be null");
            }

            HostAddress      = hostAddress;
            SigningKey       = string.Empty;
            SubscriberId     = "0";
            _retrieveFromHub = retrieveFromHub;
        }
        /// <summary>
        ///     Allows interaction with a template located in a HotDocs Web API cache
        /// </summary>
        /// <param name="packageID">The Package ID of the template located in the cache of the Web API</param>
        /// <param name="hostAddress">The URI for the Web API</param>
        /// <param name="retrieveFromHub">
        ///     Indicates if the template is stored in a Template Hub and if the package ID used is a
        ///     Version ID or Template ID
        /// </param>
        public WebServiceTemplateLocation(string packageID, string hostAddress,
                                          RetrieveFromHub retrieveFromHub = RetrieveFromHub.No)
            : base(packageID)
        {
            if (string.IsNullOrEmpty(hostAddress))
            {
                throw new ArgumentNullException("hostAddress");
            }

            HostAddress     = hostAddress;
            RetrieveFromHub = retrieveFromHub;

            //Not used in Web API
            SubscriberId = "0";
            SigningKey   = string.Empty;
        }
Example #3
0
        /// <summary>
        ///     Constructs a Client object.
        /// </summary>
        public RestClient(
            string subscriberId,
            string signingKey,
            string outputDir                = null,
            string hostAddress              = null,
            string proxyServerAddress       = null,
            RetrieveFromHub retrieveFromHub = RetrieveFromHub.No)
            : base(subscriberId, signingKey, hostAddress, "RestfulSvc.svc", proxyServerAddress)
        {
            OutputDir = outputDir ?? _defaultOutputDir;
            SetTcpKeepAlive();
            _retrieveFromHub = retrieveFromHub;

#if DEBUG
            // For debug builds, allow invalid server certificates.
            ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
#endif
        }
        /// <summary>
        ///     Allows connection to a HotDocs Cloud Services API
        /// </summary>
        /// <param name="retrieveFromHub">
        ///     Indicates if the template is stored in a Template Hub and if the package ID used is a
        ///     Version ID or Template ID
        /// </param>
        /// <param name="hostAddress">The address of the Cloud Services API</param>
        /// <param name="subscriberId">Your Unique SubscriberId</param>
        /// <param name="signingKey">Your Unique Signing Key</param>
        public HotDocsService(string subscriberId, string signingKey,
                              RetrieveFromHub retrieveFromHub = RetrieveFromHub.No, string hostAddress = "https://cloud.hotdocs.ws/hdcs")
        {
            if (string.IsNullOrWhiteSpace(hostAddress))
            {
                throw new ArgumentNullException("hostAddress");
            }

            if (string.IsNullOrWhiteSpace(subscriberId))
            {
                throw new ArgumentNullException("subscriberId");
            }

            if (string.IsNullOrWhiteSpace(signingKey))
            {
                throw new ArgumentNullException("signingKey");
            }

            HostAddress      = hostAddress;
            SigningKey       = signingKey;
            _retrieveFromHub = retrieveFromHub;
            SubscriberId     = subscriberId;
        }
        /// <summary>
        /// </summary>
        /// <param name="packageID">The Package ID of the template located in the cache of the Cloud Services or the Template Hub</param>
        /// <param name="hostAddress">The URI for Cloud Services</param>
        /// <param name="subscriberId">The subscriber ID for a Cloud Services account</param>
        /// <param name="signingKey">The Signing Key for a Cloud Services account</param>
        /// <param name="retrieveFromHub">
        ///     Indicates if the template is stored in a Template Hub and if the package ID used is a
        ///     Version ID or Template ID
        /// </param>
        public WebServiceTemplateLocation(string packageID, string subscriberId, string signingKey,
                                          RetrieveFromHub retrieveFromHub = RetrieveFromHub.No, string hostAddress = "https://cloud.hotdocs.ws")
            : base(packageID)
        {
            if (string.IsNullOrEmpty(hostAddress))
            {
                throw new ArgumentNullException("hostAddress");
            }

            if (string.IsNullOrEmpty(subscriberId))
            {
                throw new ArgumentNullException("subscriberId");
            }

            if (string.IsNullOrEmpty(signingKey))
            {
                throw new ArgumentNullException("signingKey");
            }

            HostAddress     = hostAddress;
            SubscriberId    = subscriberId;
            SigningKey      = signingKey;
            RetrieveFromHub = retrieveFromHub;
        }