title: WCF and Input Parameter Order in SOAP Envelope
body: <p>I'm getting an Object reference not set to an instance of object error in my WCF web service which uses webHttpBinding (soap 1.1) I have noticed that if you have the input parameters in a certain order the error does not get raised.</p>
  
  <p>i.e.</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:not="http://schemas.globalfoundries.com/NotificationService"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;not:NotifyWorkflowItemUpdate&gt;
           &lt;not:userIDs&gt;testUserID&lt;/not:userIDs&gt;
           &lt;not:taskID&gt;testTaskID&lt;/not:taskID&gt;
           &lt;not:taskType&gt;testTaskType&lt;/not:taskType&gt;
           &lt;not:status&gt;testStatus&lt;/not:status&gt;
           &lt;not:appID&gt;testAppID&lt;/not:appID&gt;
           &lt;not:message&gt;testMessage&lt;/not:message&gt;
        &lt;/not:NotifyWorkflowItemUpdate&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>However if I change the order of the input parameters in the request template I get the aforementioned error. i.e. (note message and userIDs parameters are switched)</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:not="http://schemas.globalfoundries.com/NotificationService"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;not:NotifyWorkflowItemUpdate&gt;
       &lt;not:message&gt;testMessage&lt;/not:message&gt;
           &lt;not:taskID&gt;testTaskID&lt;/not:taskID&gt;
           &lt;not:taskType&gt;testTaskType&lt;/not:taskType&gt;
           &lt;not:status&gt;testStatus&lt;/not:status&gt;
           &lt;not:appID&gt;testAppID&lt;/not:appID&gt;
           &lt;not:userIDs&gt;testUserID&lt;/not:userIDs&gt;
        &lt;/not:NotifyWorkflowItemUpdate&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Why is this happening? Are request parameters mapped to the .Net method parameters via the order and not by the names? Is there an attribute that I have to specify on the service contract to make named parameter mapping possible?</p>