private ResponseBaseType DoVerification(byte[] documentData, String mimeType,
                                                bool returnSignerIdentity, bool returnVerificationReport)
        {
            Console.WriteLine("Verify");

            // setup the client
            SetupClient();

            String        requestId     = "dss-verify-request-" + Guid.NewGuid().ToString();
            VerifyRequest verifyRequest = new VerifyRequest();

            verifyRequest.RequestID = requestId;

            AnyType           optionalInputs        = new AnyType();
            List <XmlElement> optionalInputElements = new List <XmlElement>();

            if (returnSignerIdentity)
            {
                XmlElement e = GetElement("dss", "ReturnSignerIdentity", DSSConstants.DSS_NAMESPACE);
                optionalInputElements.Add(e);
            }

            if (returnVerificationReport)
            {
                DSSXSDNamespace.ReturnVerificationReport returnVerificationReportElement =
                    new DSSXSDNamespace.ReturnVerificationReport();
                returnVerificationReportElement.IncludeVerifier          = false;
                returnVerificationReportElement.IncludeCertificateValues = true;
                returnVerificationReportElement.ReportDetailLevel        =
                    "urn:oasis:names:tc:dss-x:1.0:profiles:verificationreport:reportdetail:noDetails";

                XmlElement e = ToDom("ReturnVerificationReport", DSSConstants.VR_NAMESPACE,
                                     returnVerificationReportElement, typeof(DSSXSDNamespace.ReturnVerificationReport));

                optionalInputElements.Add(e);
            }

            if (optionalInputElements.Count > 0)
            {
                optionalInputs.Any           = optionalInputElements.ToArray();
                verifyRequest.OptionalInputs = optionalInputs;
            }

            verifyRequest.InputDocuments = GetInputDocuments(documentData, mimeType);

            // operate
            ResponseBaseType response = this.client.verify(verifyRequest);

            // check response
            CheckResponse(response, verifyRequest.RequestID);

            return(response);
        }
        private ResponseBaseType DoVerification(byte[] documentData, String mimeType,
            bool returnSignerIdentity, bool returnVerificationReport)
        {
            Console.WriteLine("Verify");

            // setup the client
            SetupClient();

            String requestId = "dss-verify-request-" + Guid.NewGuid().ToString();
            VerifyRequest verifyRequest = new VerifyRequest();
            verifyRequest.RequestID = requestId;

            AnyType optionalInputs = new AnyType();
            List<XmlElement> optionalInputElements = new List<XmlElement>();
            if (returnSignerIdentity)
            {
                XmlElement e = GetElement("dss", "ReturnSignerIdentity", DSSConstants.DSS_NAMESPACE);
                optionalInputElements.Add(e);
            }

            if (returnVerificationReport)
            {
                DSSXSDNamespace.ReturnVerificationReport returnVerificationReportElement =
                    new DSSXSDNamespace.ReturnVerificationReport();
                returnVerificationReportElement.IncludeVerifier = false;
                returnVerificationReportElement.IncludeCertificateValues = true;
                returnVerificationReportElement.ReportDetailLevel =
                    "urn:oasis:names:tc:dss-x:1.0:profiles:verificationreport:reportdetail:noDetails";

                XmlElement e = ToDom("ReturnVerificationReport", DSSConstants.VR_NAMESPACE,
                    returnVerificationReportElement, typeof(DSSXSDNamespace.ReturnVerificationReport));

                optionalInputElements.Add(e);
            }

            if (optionalInputElements.Count > 0)
            {
                optionalInputs.Any = optionalInputElements.ToArray();
                verifyRequest.OptionalInputs = optionalInputs;
            }

            verifyRequest.InputDocuments = GetInputDocuments(documentData, mimeType);

            // operate
            ResponseBaseType response = this.client.verify(verifyRequest);

            // check response
            CheckResponse(response, verifyRequest.RequestID);

            return response;
        }