title: Error 403 when try to POST Data to web services
body: <p>I try to post Data to a remote server (Windows Server 2012 R2, IIS 7), and only one of my class is not working I receive (Error 403), but my data are stored on my sqlite file. </p>
  
  <p>I'm not sure about this part of my code:</p>
  
  <pre><code>        public object Post(PatientSessionADD request)
      {
          PatientSessionCRUDFunctions PSCF = new PatientSessionCRUDFunctions(Db);
          PatientDetailsCRUDFunctions PDCF = new PatientDetailsCRUDFunctions(Db);
  
          // Create the new Session
  
              // Start Session
              var p = new PatientSession()
              {
                  ByPatientId = request.ByPatientId,
                  PatientStartSessionTime = request.PatientStartSessionTime,
                  PatientStartSessionByUserId = request.PatientStartSessionByUserId
              };
  
              patientsessionid = PSCF.AddPatientSession(p);
  
              // --- Generate folder + Images ---
              // Get AgeBlock
              var PatientDetails = PDCF.GetPatientDetailsByID(p.ByPatientId);
              string ageblock = PatientDetails.AgeBlock;
              // Generate path with Session ID
              pdp.GeneratePath(patientsessionid);
              // Call image generator and create images
              TempImageCreationClass.GenerateChartImage(Convert.ToInt32(ageblock));
  
              // Return a JSON Response
              return new PatientSessionADDResponse 
              {
                  PatientSessionId = patientsessionid
              };}
  </code></pre>
  
  <p>When I call my function AddPatientSession directly from my JSON response, I don't get the error 403.
  There here my function to ADD Data in the database:</p>
  
  <pre><code>public class PatientSessionCRUDFunctions
  {
      // The IDbConnection passed in from the IOC container on the service
      System.Data.IDbConnection _dbConnection;
  
      // Store the database connection passed in
      public PatientSessionCRUDFunctions(System.Data.IDbConnection dbConnection)
      {
          _dbConnection = dbConnection;
      }
  
      // Inserts a new row into the PatientSession table
      public int AddPatientSession(PatientSession p)
      {
          return (int)_dbConnection.Insert&lt;PatientSession&gt;(p, selectIdentity: true);
      }
  }
  </code></pre>
  
  <p>Also when I test my code locally my class is working, so I checked IIS Permissions and I didn't found anything for my issue. it's really confusing because I don't know if the problem is from my code or from IIS.</p>
  
  <p>Do you see what problem it could be? Thanks</p>