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); }
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)); } }
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); } }