Пример #1
0
        private string GetAuthXML(DocuSignCredential credential)
        {
            String auth = string.Format("<DocuSignCredentials><Username>{0}</Username>"
                                        + "<Password>{1}</Password>"
                                        + "<IntegratorKey>{2}</IntegratorKey></DocuSignCredentials>", credential.UserName, credential.Password, credential.IntegratorKey);

            return(auth);
        }
Пример #2
0
        public DSAPIService.DocumentPDFs RequestDocumentPDFs(DocuSignCredential credential, string envelopeID)
        {
            DSAPIService.DSAPIServiceSoapClient svc = new DSAPIService.DSAPIServiceSoapClient();

            using (OperationContextScope scope = new OperationContextScope(svc.InnerChannel))
            {
                HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
                httpRequestProperty.Headers.Add("X-DocuSign-Authentication", GetAuthXML(credential));
                OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;

                return(svc.RequestDocumentPDFs(envelopeID));
            }
        }
Пример #3
0
        public DSAPIService.EnvelopeStatus CreateAndSendEnvelope(DocuSignCredential credential, DSAPIService.Envelope envelope)
        {
            DSAPIService.DSAPIServiceSoapClient svc = new DSAPIService.DSAPIServiceSoapClient();

            using (OperationContextScope scope = new System.ServiceModel.OperationContextScope(svc.InnerChannel))
            {
                HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
                httpRequestProperty.Headers.Add("X-DocuSign-Authentication", GetAuthXML(credential));
                OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;

                DSAPIService.EnvelopeStatus status = svc.CreateAndSendEnvelope(envelope);
                return(status);
            }
        }