none
DocuSign Connect Serialization RRS feed

  • Question

  • Hello,

    I'm trying to receive envelopes from DocuSign Connect - but the XML isn't being deserialized properly.

    I found a link here that seemed to indicate how to solve the issue but it's still not working.

    http://stackoverflow.com/questions/20686436/why-is-my-wcf-web-service-presenting-this-object-in-a-different-namespace-with-d

    I can see that the data is being received in WireShark but it always appears null in my method.

    Here is an example of the request:

    <soap:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <wsa:Action>DocuSignConnectListener/Operations/DocuSignConnectUpdate</wsa:Action>
        <wsa:MessageID>urn:1482b</wsa:MessageID>
        <wsa:ReplyTo>
          <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
        </wsa:ReplyTo>
        <wsa:To>http://myurl.com/DocuSignConnectListener/Operations</wsa:To>
        <wsse:Security>
          <wsu:Timestamp wsu:Id="Timestamp-dd9955c2-7602-4254-ad36-824043e7348f">
            <wsu:Created>2017-02-27T23:03:04Z</wsu:Created>
            <wsu:Expires>2017-02-27T23:08:04Z</wsu:Expires>
          </wsu:Timestamp>
        </wsse:Security>
        <To soap:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://myurl.com:84/DocuSignConnectListener/Operations</To>
        <Action soap:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">DocuSignConnectListener/Operations/DocuSignConnectUpdate</Action>
      </soap:Header>
      <soap:Body>
            <DocuSignConnectUpdate xmlns="DocuSignConnectListener/Operations">
       <DocuSignEnvelopeInformation>
      <EnvelopeStatus xmlns="http://www.docusign.net/API/3.0">
         <EnvelopeID>61234aaa</EnvelopeID>
                  </EnvelopeStatus>
    </DocuSignEnvelopeInformation>
    </DocuSignConnectUpdate>
      </soap:Body>
    </soap:Envelope>

    Here is my interface

    namespace DocuSignConnectListener
    {   
        [ServiceContract(ConfigurationName="IOperations", Namespace="https://www.docusign.net/API/3.0")]    
        public interface IOperations
        {
            [OperationContract(Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate")]
            [XmlSerializerFormat]
            string DocuSignConnectUpdate(DocuSignAPI.DocuSignEnvelopeInformation DocuSignEnvelopeInformation);
        }
    }

    I'm wonder if the issue has something to do with the way I had to format my Action as "DocuSignConnectListener/Operations/DocuSignConnectUpdate" instead of just "DocuSignConnectUpdate"

    Any assistance would be appreciated.

    Thank you very much!









    • Edited by Hiline1961 Monday, February 27, 2017 11:17 PM
    Monday, February 27, 2017 8:40 PM

Answers

  • Well, I ended up writing a Message Inspector (IDispatchMessageInspector) to see the body that was being received.

    In various Google links I saw the namespace as such:

    namespace DocuSignConnectListener
    {   
        [ServiceContract(ConfigurationName="IOperations", Namespace="https://www.docusign.net/API/3.0")]    
        public interface IOperations
        {
            [OperationContract(Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate")]        
            [XmlSerializerFormat]
            string DocuSignConnectUpdate(DocuSignEnvelopeInformation DocuSignEnvelopeInformation);
        }
    }

    But, using the Message Inspector I saw that based upon our Connect configuration the body being received was as such:

    <DocuSignConnectUpdate xmlns="DocuSignConnectListener/Operations">
      <DocuSignEnvelopeInformation>
        <EnvelopeStatus xmlns="http://www.docusign.net/API/3.0">
          <EnvelopeID>144</EnvelopeID>
        </EnvelopeStatus>
      </DocuSignEnvelopeInformation>
    </DocuSignConnectUpdate>

    So, here is my Interface that worked:

    namespace DocuSignConnectListener
    {   
        [ServiceContract(ConfigurationName="IOperations", Namespace="DocuSignConnectListener/Operations")]    
        public interface IOperations
        {
            [OperationContract(Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate")]        
            [XmlSerializerFormat]
            string DocuSignConnectUpdate(DocuSignEnvelopeInformation DocuSignEnvelopeInformation);
        }
    }

    Oh, by the way, to find the Action issue I went to Connect Admin at DocuSign and selected Failures.  I would see a message such as Contract Mismatch for Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate" which let me to set my Action as such.

    And, don't forget to use the XmlSerializerFormat attribute.  The default Data Contract serializer won't work.

    Hope this helps! Thanks all.




    • Marked as answer by Hiline1961 Tuesday, February 28, 2017 7:54 PM
    • Edited by Hiline1961 Tuesday, February 28, 2017 8:03 PM
    Tuesday, February 28, 2017 7:53 PM

All replies

  • Hi Hiline,

    Will you get any different result by using removing Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate"?

    Could you share us more detailed information about your project? DocuSign seems to be a service, and you create a service. Do you mean you create a wcf service to call DocuSign? If so, did you get null in wcf service or wcf client? Did you use docusign-soap-sdk?

    In addition, has your below thread been resolved? If you have, it would be appreciated if you could share us your solution, if not, please feel free to keep following.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 28, 2017 2:19 AM
  • Well, I ended up writing a Message Inspector (IDispatchMessageInspector) to see the body that was being received.

    In various Google links I saw the namespace as such:

    namespace DocuSignConnectListener
    {   
        [ServiceContract(ConfigurationName="IOperations", Namespace="https://www.docusign.net/API/3.0")]    
        public interface IOperations
        {
            [OperationContract(Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate")]        
            [XmlSerializerFormat]
            string DocuSignConnectUpdate(DocuSignEnvelopeInformation DocuSignEnvelopeInformation);
        }
    }

    But, using the Message Inspector I saw that based upon our Connect configuration the body being received was as such:

    <DocuSignConnectUpdate xmlns="DocuSignConnectListener/Operations">
      <DocuSignEnvelopeInformation>
        <EnvelopeStatus xmlns="http://www.docusign.net/API/3.0">
          <EnvelopeID>144</EnvelopeID>
        </EnvelopeStatus>
      </DocuSignEnvelopeInformation>
    </DocuSignConnectUpdate>

    So, here is my Interface that worked:

    namespace DocuSignConnectListener
    {   
        [ServiceContract(ConfigurationName="IOperations", Namespace="DocuSignConnectListener/Operations")]    
        public interface IOperations
        {
            [OperationContract(Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate")]        
            [XmlSerializerFormat]
            string DocuSignConnectUpdate(DocuSignEnvelopeInformation DocuSignEnvelopeInformation);
        }
    }

    Oh, by the way, to find the Action issue I went to Connect Admin at DocuSign and selected Failures.  I would see a message such as Contract Mismatch for Action="DocuSignConnectListener/Operations/DocuSignConnectUpdate" which let me to set my Action as such.

    And, don't forget to use the XmlSerializerFormat attribute.  The default Data Contract serializer won't work.

    Hope this helps! Thanks all.




    • Marked as answer by Hiline1961 Tuesday, February 28, 2017 7:54 PM
    • Edited by Hiline1961 Tuesday, February 28, 2017 8:03 PM
    Tuesday, February 28, 2017 7:53 PM