title: WCF expected to find node type Element with name
body: <p>Given this WSDL:
  <a href="https://ca-test.adyen.com/ca/services/Notification?wsdl" rel="nofollow">Adyen notification WSDL</a><br>
  And this svcutil command to create the corresponding C# class:  </p>
  
  <pre><code>svcutil.exe https://ca-test.adyen.com/ca/services/Notification?wsdl /t:code /l:c# /o:"C:\NotificationRequest.cs" /ct:System.Collections.Generic.List`1
  </code></pre>
  
  <p>And the OperationContract:  </p>
  
  <pre><code>[OperationContract(Action="http://notification.services.adyen.com/sendNotification")]  
  string SendNotification(NotificationRequest notificationRequest);
  </code></pre>
  
  <p>Calling the SendNotification method (SOAP) works with WCFStorm.<br>
  But when I call the method via the Third Party website, which has a test button, I get:  </p>
  
  <blockquote>
    <p>OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'SendNotification' and namespace '<a href="http://tempuri.org/" rel="nofollow">http://tempuri.org/</a>'. Found node type 'Element' with name 'ns1:sendNotification' and namespace '<a href="http://notification.services.adyen.com" rel="nofollow">http://notification.services.adyen.com</a>'</p>
  </blockquote>
  
  <p>This is the part of the Third Party request call that gives me the problem:  </p>
  
  <pre><code>&lt;soap:Body&gt;&lt;ns1:sendNotification xmlns:ns1="http://notification.services.adyen.com"&gt;&lt;ns1:notification&gt;
  </code></pre>
  
  <p>How can I fix this with, preferably, some small C# attribute directives?</p>
  
  <p><strong>UPDATE</strong><br>
  Fixed the '<a href="http://tempuri.org/" rel="nofollow">http://tempuri.org/</a>'-part of the problem by adding a namespace to the <em>IPSPNotificationService</em> ServiceContract:  </p>
  
  <pre><code>[ServiceContract(Namespace = "http://notification.services.adyen.com")]
  public interface IPSPNotificationService
  </code></pre>
  
  <p><strong>UPDATE 2</strong><br>
  By changing the OperationContract WCFStorm still works fine. Now the method is also fired by the Third Party call, but the NotificationRequest param, in this case, is NULL:  </p>
  
  <pre><code>[OperationContract(Action="http://notification.services.adyen.com/sendNotification", Name="sendNotification")]
  string SendNotification(NotificationRequest notificationRequest);
  </code></pre>
  
  <p><strong>UPDATE 3</strong><br>
  Let's look at it in a simpler way. Given the xml below, what contract/service decorations do I need?  </p>
  
  <pre><code>&lt;E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"&gt;
      &lt;System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"&gt;
          &lt;EventID&gt;0&lt;/EventID&gt;
          &lt;Type&gt;3&lt;/Type&gt;
          &lt;SubType Name="Information"&gt;0&lt;/SubType&gt;
          &lt;Level&gt;8&lt;/Level&gt;
          &lt;TimeCreated SystemTime="2016-03-08T10:27:30.7325676Z" /&gt;
          &lt;Source Name="System.ServiceModel.MessageLogging" /&gt;
          &lt;Correlation ActivityID="{742fac90-3b97-4c9f-aee3-fd2589f75c37}" /&gt;
          &lt;Execution ProcessName="obscured" ProcessID="13280" ThreadID="11" /&gt;
          &lt;Channel /&gt;
          &lt;Computer&gt;obscured&lt;/Computer&gt;
      &lt;/System&gt;
      &lt;ApplicationData&gt;
          &lt;TraceData&gt;
              &lt;DataItem&gt;
                  &lt;MessageLogTraceRecord Time="2016-03-08T11:27:30.7315670+01:00" Source="TransportReceive" Type="System.ServiceModel.Channels.BufferedMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace"&gt;
                      &lt;HttpRequest&gt;
                          &lt;Method&gt;POST&lt;/Method&gt;
                          &lt;QueryString/&gt;
                          &lt;WebHeaders&gt;
                              &lt;SOAPAction&gt;"http://notification.services.adyen.com/sendNotification"&lt;/SOAPAction&gt;
                              &lt;Content-Length&gt;1140&lt;/Content-Length&gt;
                              &lt;Content-Type&gt;text/xml; charset=UTF-8&lt;/Content-Type&gt;
                              &lt;Authorization&gt;Basic obscured&lt;/Authorization&gt;
                              &lt;Host&gt;obscured&lt;/Host&gt;
                              &lt;User-Agent&gt;Jakarta Commons-HttpClient/3.0.1&lt;/User-Agent&gt;
                          &lt;/WebHeaders&gt;
                      &lt;/HttpRequest&gt;
                      &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
                          &lt;s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
                              &lt;To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;https://obscured&lt;/To&gt;
                              &lt;Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt;http://notification.services.adyen.com/sendNotification&lt;/Action&gt;
                          &lt;/s:Header&gt;
                          &lt;soap:Body&gt;
                              &lt;ns1:sendNotification xmlns:ns1="http://notification.services.adyen.com"&gt;
                                  &lt;ns1:notification&gt;
                                      &lt;live xmlns="http://notification.services.adyen.com"&gt;false&lt;/live&gt;
                                      &lt;notificationItems xmlns="http://notification.services.adyen.com"&gt;
                                          &lt;NotificationRequestItem&gt;
                                              &lt;additionalData xsi:nil="true"/&gt;
                                              &lt;amount&gt;
                                                  &lt;currency xmlns="http://common.services.adyen.com"&gt;EUR&lt;/currency&gt;
                                                  &lt;value xmlns="http://common.services.adyen.com"&gt;10000&lt;/value&gt;
                                              &lt;/amount&gt;
                                              &lt;eventCode&gt;AUTHORISATION&lt;/eventCode&gt;
                                              &lt;eventDate&gt;2016-03-08T11:27:55.572+01:00&lt;/eventDate&gt;
                                              &lt;merchantAccountCode&gt;obscured&lt;/merchantAccountCode&gt;
                                              &lt;merchantReference&gt;obscured&lt;/merchantReference&gt;
                                              &lt;operations&gt;
                                                  &lt;string&gt;REFUND&lt;/string&gt;
                                              &lt;/operations&gt;
                                              &lt;originalReference xsi:nil="true"/&gt;
                                              &lt;paymentMethod&gt;ideal&lt;/paymentMethod&gt;
                                              &lt;pspReference&gt;obscured&lt;/pspReference&gt;
                                              &lt;reason/&gt;
                                              &lt;success&gt;true&lt;/success&gt;
                                          &lt;/NotificationRequestItem&gt;
                                      &lt;/notificationItems&gt;
                                  &lt;/ns1:notification&gt;
                              &lt;/ns1:sendNotification&gt;
                          &lt;/soap:Body&gt;
                      &lt;/soap:Envelope&gt;
                  &lt;/MessageLogTraceRecord&gt;
              &lt;/DataItem&gt;
          &lt;/TraceData&gt;
      &lt;/ApplicationData&gt;
  &lt;/E2ETraceEvent&gt;
  </code></pre>
  
  <p><strong>Final update</strong><br>
  I gave up, I saw that the third party can also send JSON posts. I adapted the configuration to use webHttpBinding, converted the example JSON to a datacontract and deserialize the posted message from the OperationContext.Current.RequestContext.RequestMessage.</p>