title: GetProfiles Issue When Accessing Hikvision Cameras Programmatically Via ONVIF
body: <p>PROBLEM:</p>
  
  <p>I have a number of test cameras that I'm using in development of a Cocoa ONVIF driver. I have AXIS, Dahua and Hikvision (so far -more will be coming).</p>
  
  <p>All of the cameras claim conformance to Profile S and Profile G.</p>
  
  <p>The AXIS cameras are the only ones that are behaving as expected.</p>
  
  <p>Most can return RTSP image data if I send a direct URI to them (which, I see, is how most "ONVIF" apps seem to work).</p>
  
  <p>What I am trying to do, is use the "proper channels" to access these devices.</p>
  
  <p>That means running the MANDATORY GetProfiles query, like so:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
   xmlns:trt="http://www.onvif.org/ver10/media/wsdl"&gt;
      &lt;soap:Body&gt;
          &lt;trt:GetProfiles/&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>That's textbook. Straight out of the ONVIF application programming guide. I'm using a REST injection app to test this, using POST. I have set up authentication as Basic, using a full admin user.</p>
  
  <p>The issue is that Hikvision cameras consistently return an <em>"Optional Action Not Implemented"</em> fault, which is their way of saying "We don't like what you sent".</p>
  
  <p>I should note that the Core commands, like "GetServices" and "GetCapabilities" work just fine.</p>
  
  <p>There is precious little lessons learned stuff out there on ONVIF. I think it's a standard that is still struggling to stand up on its own.</p>
  
  <p>The only thing I've seen out there is <a href="https://github.com/rvi/ONVIFCamera/issues/4" rel="nofollow noreferrer">this post</a>.</p>
  
  <p>That does not apply to me. The same issue happens when I use either WSDL version.</p>
  
  <p>When I Wireshark the apps that can connect to the camera, all I see is that they directly send an RTSP URI. No mention of "GetProfiles".</p>
  
  <p>My question is this an issue that anyone else has encountered?</p>
  
  <p>If so, how was it solved? I am learning to loathe the ONVIF spec, as it gets real hard to find detailed packet descriptions.</p>