servicestack

Encrypting messages over ServiceStack

最后都变了- 提交于 2019-12-06 08:23:55
问题 Given an app that needs to exchange info such as ConsumerKey/ConsumerSecret for oAuth from - server running "WebApi" over ServiceStack - consumer is a desktop app Looking to encrypt the messages using Public/Private keys which are already in place Is there any support for encrypting/decrypting messages, hopefully transparently ? i.e. the encrypting/decryption is handled via say Filters on the server ? OR any workaround on how to do this ? FYI - the server already requires SSL and requests are

Authentication and Authorization with ServiceStack.MVC

寵の児 提交于 2019-12-06 08:15:44
AuthorizeAttribute is useless while using ServiceStack.Mvc AuthenticateAttribute is for DTO objects. There is no sample for AccountController with ServiceStack, Signout is not working in SocialBootStrapApi. Where is the basic Login,Logout,Authorize with Roles samples with ServiceStack.Mvc? (Not single page application, classic Asp.Net Mvc) ServiceStack doesn't use the ASP.NET's or MVC's Authentication or anything that relies on it e.g. MVC's AccountController, it uses its own Authentication Provider . AuthenticateAttribute and any other ServiceStack Request or Response Filter attributes can in

How does PubSub work in BookSleeve/ Redis?

烈酒焚心 提交于 2019-12-06 08:15:27
问题 I wonder what the best way is to publish and subscribe to channels using BookSleeve. I currently implement several static methods (see below) that let me publish content to a specific channel with the newly created channel being stored in private static Dictionary<string, RedisSubscriberConnection> subscribedChannels; . Is this the right approach, given I want to publish to channels and subscribe to channels within the same application (note: my wrapper is a static class). Is it enough to

How to send commands using ServiceStack?

Deadly 提交于 2019-12-06 07:31:38
I am just getting into REST and ServiceStack and for now my GETs are returning strings which could be XML or Json. I now need to work on the PUT or POST commands which change my domain model. For a single resource, I could have a number of commands on my domain model (i.e for a customer resource I could have change name, change address, change billing address, etc). Each change to the domain model will consist of only one of these changes (not all). With ServiceStack do I create ONE DTO which contains a flag/enumeration to indicate what the change is? This means I have one REST service with a

Using Elmah with ServiceStack.Mvc

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:31:38
问题 I could not see unhandled exceptions ( MyService:RestServiceBase) on /elmah.axd path. I've added http handlers for seeing errors. <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> I've installed ServiceStack.Logging.Elmah UPDATE I've installed Elmah.Mvc package also I can get errors in Controller's Action but I could not get service errors! UPDATE I'm not alone :) https://groups.google.com/forum/#!topic/servicestack/WSrM5CLL120 回答1: You need subscribe to

What's the precise differences between the following three lines in a MVC controller inheriting from ServiceStackController

守給你的承諾、 提交于 2019-12-06 07:28:38
What's the precise differences between the following three lines in a MVC controller inheriting from ServiceStackController? (I cannot find the difference explained in any documentation) //A - (default: reload = true) var session = GetSession(); //B var session = GetSession(false); //C var session = SessionAs<IAuthSession>(); GetSession is better named GetOrCreateSession as it will either Get a Typed Session or create a new one if it doesn't exist. It also stores the instance of the Session in HTTP Request Context where if reload:false will return the local instance when it exists:

Consuming Web Service HTTP Post

血红的双手。 提交于 2019-12-06 07:24:55
I'm consuming a web-service with ServiceStack . The header expected is: POST /SeizureWebService/Service.asmx/SeizureAPILogs HTTP/1.1 Host: host.com Content-Type: application/x-www-form-urlencoded Content-Length: length jsonRequest=string I'm trying to consume it with this code: public class JsonCustomClient : JsonServiceClient { public override string Format { get { return "x-www-form-urlencoded"; } } public override void SerializeToStream(ServiceStack.ServiceHost.IRequestContext requestContext, object request, System.IO.Stream stream) { string message = "jsonRequest="; using (StreamWriter sw

Is it possible to auto generate nice documentation for REST API created by ServiceStack?

大憨熊 提交于 2019-12-06 06:13:20
问题 There are existing tools for auto generating API documentation - most of the weren't designed for REST services. For all of you who have created REST services using ServiceStack - how did you write the docs ? Manual / semi-auto / fully auto-gen ? I'm even considering auto gen a customized WADL and connecting it to something like apigee Console To Go (oh and RESTafaries- please spare the 'REST api should be auto discoverable and self-explained' mantra...I really want nice looking docs for my

Servicestack client/text licensing [closed]

坚强是说给别人听的谎言 提交于 2019-12-06 05:41:55
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . We started using servicestack v4, rest assured that there where no licensing limits on the client. At least that's what I could read out of servicestack's download page . We are building our project according to mythz' answer to this question on servicestack how to structure an api. The generic client works (so far) as expected without setting a license, but when a colleague created a test-client against the

401 error when using [Authenticate] with BasicAuthProvider

徘徊边缘 提交于 2019-12-06 05:17:56
I'm having some trouble with authenticating with ServiceStack using the BasicAuthProvider. All works well when I authenticate using the provider route 'auth/myauth' but when I go to one of my other service DTOS that use the [Authenticate] attribute e.g. /hello, I always get a 401 Unauthorized error even when I always supply the basic authentication details in the 'Authorization' header using beforeSend with jQuery. Basically, I'm building an API for a mobile app that involves credential authentication on the first time(or if a supplied token isn't expired), then subsequently basic