title: SOAP Action mismatch trying to implement ONVIF server
body: <p>I am trying to implement a C# WCF server to the ONVIF specifications at <a href="http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl" rel="nofollow">http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl</a>. I have generated the contract code using</p>
  
  <pre><code> SvcUtil.exe http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
  </code></pre>
  
  <p>which generates <code>Device</code> and <code>PTZ</code> interfaces. I then created an implementation of the generated interfaces and expose that using a <code>ServiceHost</code> like this:</p>
  
  <pre><code>        serviceHost = new ServiceHost(typeof(OnvifImpl), baseUri);
  
          serviceHost.AddServiceEndpoint(typeof(Device), new WSHttpBinding(), "device_service");
          serviceHost.AddServiceEndpoint(typeof(PTZ), new WSHttpBinding(), "ptz");
  </code></pre>
  
  <p>When I point Onvif Device Manager 2.2.250 (<a href="https://sourceforge.net/projects/onvifdm/" rel="nofollow">https://sourceforge.net/projects/onvifdm/</a>) at my server, I get an exception in my server "The SOAP action specified on the message, '', does not match the HTTP SOAP Action, '<a href="http://www.onvif.org/ver10/device/wsdl/GetScopes" rel="nofollow">http://www.onvif.org/ver10/device/wsdl/GetScopes</a>'.". Wireshark shows that the request does not have any SOAP header. However, as far as I can tell, the client was developed against the same WSDL files. </p>
  
  <p>I am afraid I am completely new to ONVIF, SOAP, Web services and WCF, so I have no idea where the problem may be. I have seen various suggestions to modify the client, but that is not an option.</p>