Beispiel #1
0
        }         // LoadConfiguration

        private void CreateClient()
        {
            this.echoSign = new EchoSignClient(
                new BasicHttpsBinding {
                MaxBufferSize          = 65536000,
                MaxReceivedMessageSize = 65536000,
                MaxBufferPoolSize      = 524288,
            },
                new EndpointAddress(this.url)
                );

            this.log.Debug("EchoSign ping test...");

            Pong pong = this.echoSign.testPing(this.apiKey);

            if (pong.message == ExpectedPong)
            {
                this.log.Debug("EchoSign ping succeeded.");
            }
            else
            {
                this.log.Alert("EchoSign ping failed! Pong is: {0}", pong.message);
                this.isReady = false;
                return;
            }             // if

            this.log.Debug("EchoSign echo test...");

            byte[] oTestData = Serialized.AsBase64(string.Format(
                                                       "Current time is {0}.",
                                                       DateTime.UtcNow.ToString("MMMM d yyyy HH:mm:ss", CultureInfo.InvariantCulture)
                                                       ));

            byte[] oTestResult = this.echoSign.testEchoFile(this.apiKey, oTestData);

            this.isReady = (oTestData.Length == oTestResult.Length) && oTestData.SequenceEqual(oTestResult);

            if (this.isReady)
            {
                this.log.Debug("EchoSign echo succeeded.");
            }
            else
            {
                this.log.Alert("EchoSign echo failed!");
            }
        } // CreateClient