servicestack

servicestack self-hosted service uses chunked encoding - is unbuffered?

守給你的承諾、 提交于 2019-12-22 12:39:12
问题 I am trying to learn ServiceStack with the hello world examples and self-hosted example. I am making requests for JSON content. I have noticed the following in the response headers: Basic service hosted in an ASP.Net project: HTTP/1.1 200 OK Server: ASP.NET Development Server/10.0.0.0 Date: Wed, 10 Apr 2013 12:49:46 GMT X-AspNet-Version: 4.0.30319 X-Powered-By: ServiceStack/3.943 Win32NT/.NET Cache-Control: private Content-Type: application/json; charset=utf-8 Content-Length: 16 <------------

Why doesn't the ServiceStack Razor FileSystemWatcher work on Mono + Mac OS X?

寵の児 提交于 2019-12-22 10:56:19
问题 ServiceStack's new support for Razor v2 uses a FileSystemWatcher to detect changes to tracked view files and mark them as invalid so they'll be recompiled at the next request. This is great for debugging as it lets you edit your views and not rebuild/restart your project. On Mono (currently running 3.0.10) on my Mac OS X (Mountain Lion) there is apparently a Mono bug where the FileSystemWatcher doesn't raise Changed events for file changes. Furthermore, it also doesn't raise any events for

Configuring lifetime scopes in autofac when used as ServiceStack's IoC

℡╲_俬逩灬. 提交于 2019-12-22 10:27:15
问题 I'm currently using AutoFac as the DI container for our ServiceStack web services app. I'm able to configure the wiring and everything, but after reading the section on Scopes, I'm at a loss at which scope would be best to use when registering my components. In our particular case, I think a PerHttpRequest scope would be OK since (please correct me if im wrong) I would want to dispose the dependencies as soon as the request ends. My question is, how do I set this up in the container? I can't

Calling a ServiceStack service from Razor

穿精又带淫゛_ 提交于 2019-12-22 09:43:46
问题 A bit of an edge case here: I need to call a servicestack service from razor (same website) Right now I'm doing CheckIfConfiguredResponse aResponse= new JsonServiceClient("http:\\localhost:2000").Get<CheckIfConfiguredResponse>("/CheckIfConfigured"); Is that the proper way to go about doing it? Or is there better? Also, How do I eliminate having to specify the web address manually and have it automatically populate the host (since it's the same web site) Thanks in advance, Will. 回答1: You never

How to get HttpContext in servicestack.net

自古美人都是妖i 提交于 2019-12-22 08:42:36
问题 I am unable to switch to all of service stack's new providers, authentication, etc. So, I am running a hybrid scenario and that works great. To get the current user in service, I do this: private IPrincipal CurrentUser() { var context = HttpContext.Current; if (context != null) { var user = context.User; if (user != null) { if (!user.Identity.IsAuthenticated) return null; return user; } } return null; } Is there an alternative/better way to get the current http context directly from a service

How to get HttpContext in servicestack.net

北城余情 提交于 2019-12-22 08:40:51
问题 I am unable to switch to all of service stack's new providers, authentication, etc. So, I am running a hybrid scenario and that works great. To get the current user in service, I do this: private IPrincipal CurrentUser() { var context = HttpContext.Current; if (context != null) { var user = context.User; if (user != null) { if (!user.Identity.IsAuthenticated) return null; return user; } } return null; } Is there an alternative/better way to get the current http context directly from a service

Redis Pub/Sub ServiceStack, cancelling the thread

时光总嘲笑我的痴心妄想 提交于 2019-12-22 05:25:09
问题 This maybe a more general threading question i'm not sure. But I've got a WPF app that subscribes to channels and listens for messages from a redis database. App.SubscriptionThread = new Thread(() => { _redisSubscription.SubscribeToChannels("ChannelA", "ChannelB"); }); App.SubscriptionThread.Start(); Once I start this I have no idea how to stop it. Things I've tried. Using the Thread.Abort . This apparently doesn't stop it, as the thread just goes into a hang then forever (no unsubscription

ServiceStack Validation Not Always Firing

眉间皱痕 提交于 2019-12-22 01:39:16
问题 So I was trying to build a End To End integration testing suite with RavenDB and ServiceStack but I ran into a really weird issue where the validation doesn't run on some requests. This is really strange and I am not sure what I am doing wrong. I am using NCrunch. Sometimes the test passes, sometimes it fails. Hope this is an easy fix and something bone headed I'm doing. You can download the whole project on http://github.com/khalidabuhakmeh/endtoend You don't need anything other than VS2012

How to perform a more complex query with AutoQuery

霸气de小男生 提交于 2019-12-22 01:03:20
问题 Given the following definitions from a ServiceStack endpoint: public class LoanQueue { public int LoanId { get; set; } public DateTime Submitted { get; set; } public DateTime Funded { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public int Fico { get; set; } public int Fraud { get; set; } public int CDS { get; set; } public int IDA { get; set; } public string Income { get; set; } public string Liabilities { get; set; } public string Agent { get; set;

System.IO.IOException: Too many open files

二次信任 提交于 2019-12-21 23:17:58
问题 I'm getting this error intermittently when debugging my ServiceStack web app on Mac OS X. I can't seem to pinpoint what it is, I've tried killing the xamarin web server by using this command: ps aux | grep xsp4 | grep -v grep | awk '{print $2}' | xargs kill -9 I've tried renewing my DHCP lease and clearing my DNS cache. Even tried restarting the entire Mac. Mind you there doesn't seem to be anything wrong with the code, because when I run the Xamarin web server manually with this command: