servicestack

PooledRedisClientManager not releasing connections

喜你入骨 提交于 2019-12-03 08:37:41
I am storing lists of json data in redis and accessing it using the ServiceStack c# client. I am essentially managing my own foreign keys, where I store a zrange of ids and I use an interface internal to my application to pull the id's from the zrange and then fetch the underlying json objects from Redis and package them as a list to return to other parts of my application. I am using the PooledRedisClientManager as I anticipate Redis to be hosted on a different server from the server executing the code. I am doing all my development work locally on Windows 8, using the MSOpenTech Redis server

Block access to Redis key (ServiceStack)

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to implement what I would think is a very common caching scenario using the ServiceStack Redis client, yet I'm having difficulty finding a good example of this. In an ASP.NET MVC app, we make a relatively long-running (and metered) call to an external web service and cache the results for a certain period of time. In the cache implementation, it is desired to block additional requests for that key until the web service call has completed, to avoid additional (expensive) calls. So, what is the best way to implement a key-level lock

Use asp.net authentication with servicestack

拥有回忆 提交于 2019-12-03 08:25:13
I have written a couple of ms lightswitch applications with forms authentication -> this creates aspnet_* tables in sql server. How can I use the defined users, passwords, maybe even memberships, roles and application rights in a servicestack - application? paaschpa I have not tested this but I think it should get you started. Gladly stand corrected on any of my steps. Things I think you will need to do.. In order to Authenticate against both 'systems' you'll need to set the Forms cookie and save your ServiceStack session. Instead of calling FormsAuthentication.Authentiate() do something like

ServiceStack API and ASP MVC Authentication in two ways

南笙酒味 提交于 2019-12-03 07:56:17
问题 I'm having trouble solving architecture of an ASP MVC application that servers html pages and web services through ServiceStack. The application lives in the base url eg "http://myapplication.com" and SS lives in "http://myapplication.com/api" because it is the easiest way to configure both. In general everything works fine, but when I reached the part of the authorization and authentication, is where I'm stuck. For one, I need the application handle cookies as ASP normally do

Does ServiceStack support reverse routing?

柔情痞子 提交于 2019-12-03 07:52:21
Following REST it is advisable that API is discoverable and should be interlinked. Does ServiceStack support any kind of reverse routing? I'm looking for something like Url.RouteLink in ASP MVC. There's some mixed concepts stated here. In and effort of trying to comply with REST you wish to embed URI's in your responses. How best to achieve embedding URI's in your responses. You've assumed a "Reverse Routing" mechanism is how this should be done. REST style vs Strong-typing I want to be explicitly mention here that one doesn't imply the other. On the one hand you're looking to follow a REST

ServiceStack AppHost Is a Singleton?

社会主义新天地 提交于 2019-12-03 07:50:23
I have been evaluating ServiceStack and so far, I've been pretty much sold - but I have a requirement that I think is going to be a deal-breaker. I basically need multiple AppHost-derived instances. The first one spins up nicely, but the rest fail because "AppHostBase.Instance has already been set". Does this mean if I want multiple hosts (on different Uris), to be in different executables? If so this is rather disappointing as this library is perfect in every single other way, other than this limitation. If I am wrong, can anyone point me to a solution? Allow me to elaborate a little. We have

Fire and forget with ServiceStack's AsyncServiceBase

坚强是说给别人听的谎言 提交于 2019-12-03 07:46:00
问题 I have following service public class AppService : AsyncServiceBase<EvaluateStock> { public IBus Bus { get; set; } public override object ExecuteAsync(EvaluateStock request) { // this will block the incoming http request // unitl task is completed // long computation // Bus.Publish(result) } } which gets called by different consumers following way POST http://srv1/app/json/asynconeway/EvaluateStock Using asynconeway I was assuming that it will allow me to achieve fire and forget as WCF does

Can't get ServiceStack to work in IIS6 with HTTPS

一笑奈何 提交于 2019-12-03 07:15:33
I'm having a problem getting ServiceStack to work with HTTPS in IIS6 and I can't seem to find any documentation on setting this up. Currently I have an endpoint setup like so - http://example.com/api.ashx . When I browse to this, i get the useful ServiceStack generated page which explains the APIs available at http://example.com/api.ashx/metadata . When i browse to https://example.com/api.ashx (notice https) i instead get this error message - Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could

ServiceStack - is there an up-to date, complete documentation?

情到浓时终转凉″ 提交于 2019-12-03 06:23:10
I'm trying to wrap my head around ServiceStack, and while it claims that it has really good documentation, it doesn't seem to be the case so far. Is there a documentation that actually says which interfaces/base classes to use, and what do they do ? Just.. have a bunch of quesitons, and can find very few answers.. A new API design shows an example of DTO implementing IReturn interface, and service inheriting from Service - but there's no explanation if this is the preferred way now, is it required to implement IReturn, how to deal with POST/GET/etc, etc, etc.. Any links would be appreciated.

How to consume a file with a ServiceStack client

家住魔仙堡 提交于 2019-12-03 05:59:16
问题 I am trying to use ServiceStack to return a file to a ServiceStack client in a RESTful manner. I have read other questions on SO (here and here) which advise using HttpResult and a FileInfo object or MemoryStream to allow the ContentType header to be changed to the relevant file type. This works for me when I call the service via a browser, the correct file automatically starts to download. How do I consume the file using one of the ServiceStack clients though? I'm using a Request DTO and