Note that there are some explanatory texts on larger screens.

plurals
  1. POServiceStack Exception: 'Handler for Request not found' when trying to insert Entry to SqlLite db
    primarykey
    data
    text
    <p>I'm just learning how to use ServiceStack and I am getting an exception that I can't get past and not sure what is causing the exception. Here it is:</p> <pre><code>Handler for Request not found: Request.ApplicationPath: / Request.CurrentExecutionFilePath: /entry/5/11-11-2012 Request.FilePath: /entry/5/11-11-2012 Request.HttpMethod: GET Request.MapPath('~'): C:\Projects\Tutorials\FirstServiceStackApp\FirstServiceStackApp\ Request.Path: /entry/5/11-11-2012 Request.PathInfo: Request.ResolvedPathInfo: /entry/5/11-11-2012 Request.PhysicalPath: C:\Projects\Tutorials\FirstServiceStackApp\FirstServiceStackApp\entry\5\11-11-2012 Request.PhysicalApplicationPath: C:\Projects\Tutorials\FirstServiceStackApp\FirstServiceStackApp\ Request.QueryString: Request.RawUrl: /entry/5/11-11-2012 Request.Url.AbsoluteUri: http://localhost:52920/entry/5/11-11-2012 Request.Url.AbsolutePath: /entry/5/11-11-2012 Request.Url.Fragment: Request.Url.Host: localhost Request.Url.LocalPath: /entry/5/11-11-2012 Request.Url.Port: 52920 Request.Url.Query: Request.Url.Scheme: http Request.Url.Segments: System.String[] App.IsIntegratedPipeline: True App.WebHostPhysicalPath: C:\Projects\Tutorials\FirstServiceStackApp\FirstServiceStackApp App.WebHostRootFileNames: [entry.cs,entryservice.cs,firstservicestackapp.csproj,firstservicestackapp.csproj.user,global.asax,global.asax.cs,packages.config,recordipfilter.cs,statusquery.cs,statusservice.cs,web.config,web.debug.config,web.release.config,app_data,bin,obj,properties,scripts,x64,x86] App.DefaultHandler: metadata App.DebugLastHandlerArgs: GET|/entry/5/11-11-2012|C:\Projects\Tutorials\FirstServiceStackApp\FirstServiceStackApp\entry\5\11-11-2012 </code></pre> <p>I'm going through John Sonmez's excellent Pluralsight course on ServiceStack, and have just added the OrmLite piece to my project. This exception is thrown when I attempt to add a new Entry. So I have no SqlLite file yet in my App_Data folder, and none is created. It's not breaking in the code when I try to debug, so not sure where to look for this...</p> <p><strong>Edit: Added relevant Source Code:</strong></p> <pre><code>[Route("/entry/{Amount}/{EntryTime}", "POST")] public class Entry { ... } public class EntryService : Service { public TrackedDataRepository TDRepository { get; set; } public object Any(Entry request) { var id = TDRepository.AddEntry(request); return new EntryResponse {Id = id}; } } </code></pre> <p><strong>Solution:</strong></p> <p>Remove <strong>POST</strong> filter on Route definition so it applies to all routes:</p> <pre><code>[Route("/entry/{Amount}/{EntryTime}")] </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload