2017-05-09 4 views
0

私はDocuSign APIとConnectから始まり、Webhookを公開してイベント通知を受信しました。しかし、管理ポータルのConnect Failuresリストに404エラーが見つかりました。これは私のAPIメソッドのuriです: http://documentsigningapi.networxsolutions.co.uk/Webhook/DocumentSigned 私はこの設定を公開設定のURLに設定しています。ここでConnectを使用してイベント通知を受信するとエラーが発生する

は、コードは次のとおりです。

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Net; 
using System.Net.Http; 
using System.Web.Http; 
using System.Xml; 

namespace DocumentSigningAPI.Controllers 
{ 
    public class WebhookController : ApiController 
    {  
     public void DocumentSigned(HttpRequestMessage request) 
     {    
      var xmldoc = new XmlDocument(); 
      var result = request.Content.ReadAsStreamAsync().Result; 
      xmldoc.Load(result);   
      var mgr = new XmlNamespaceManager(xmldoc.NameTable); 
      mgr.AddNamespace("a", "http://www.docusign.net/API/3.0"); 
      XmlNode envelopeStatus = xmldoc.SelectSingleNode("//a:EnvelopeStatus", mgr); 
      XmlNode envelopeId = envelopeStatus.SelectSingleNode("//a:EnvelopeID", mgr); 
      XmlNode status = envelopeStatus.SelectSingleNode("//a:Status", mgr); 
      if (envelopeId != null) 
      { 
       System.IO.File.WriteAllText("C:/inetpub/DocumentSigningDemo/Documents/" + 
        envelopeId.InnerText + "_" + status.InnerText + "_" + Guid.NewGuid() + ".xml", xmldoc.OuterXml); 
      } 
      if (status.InnerText == "Completed") 
      { 
       // Loop through the DocumentPDFs element, storing each document. 
       XmlNode docs = xmldoc.SelectSingleNode("//a:DocumentPDFs", mgr); 
       foreach (XmlNode doc in docs.ChildNodes) 
       { 
        string documentName = doc.ChildNodes[0].InnerText; // pdf.SelectSingleNode("//a:Name", mgr).InnerText; 
        string documentId = doc.ChildNodes[2].InnerText; // pdf.SelectSingleNode("//a:DocumentID", mgr).InnerText; 
        string byteStr = doc.ChildNodes[1].InnerText; // pdf.SelectSingleNode("//a:PDFBytes", mgr).InnerText; 
        System.IO.File.WriteAllText("C:/inetpub/DocumentSigningDemo/Documents/" + envelopeId.InnerText + "_" + documentId + "_" + documentName, byteStr); 
       } 
      } 
     } 
    } 
} 
+0

これはdocusignapiではなくASP.NETの質問によく似ています。 Docusignは、公に利用可能なURLであれば、接続通知を送信します。 –

答えて

0

はAPIコントローラが見つかりませんでしたので、私は今、代わりに今働いているAPIのウェブアプリに私の機能を入れているようです。

関連する問題