FAQ Database Discussion Community


How to make ServiceStak service internal access only

.net,servicestack
I Want to make all services access internal only. Is there any way to global set RestrictAttribute to affect all services ?

How to disable ServiceStack page when accessing from web browser

servicestack
When I open my API in web browser, I get following interface. I have to click "json" to see the returned raw data. How can I disable this UI and show the raw data in web browser directly without adding the format url query string?...

ServiceStack minimum configuration to get Redis Pub/Sub working between multiple Web sites/services

servicestack,servicestack.redis
Let's say for sake of argument I have 3 web service hosts running, and only one of them has registered any handlers (which I think equates to subscribing to the channel/topic) e.g. var mqService = new RedisMqServer(container.Resolve<IRedisClientsManager>()) { DisablePriorityQueues = true }; container.Register<IMessageService>(mqService); container.Register(mqService.MessageFactory); mqService.RegisterHandler<OutboundInitiateCallInfo>(ServiceController.ExecuteMessage);...

ServiceStack MemoryCached Authentication Register User

c#,servicestack
I'm creating user service. Right now there can't be a normal repository system involved. I try to implement a authentication module for a single page app. Before i've written simply a mockup. The customer likes to see the default Auth Provider. Right now only a login service like /auth/credentials is...

Annotated Ignore field get's ignored in servicestack reponse

c#,servicestack,ormlite-servicestack
I have a request like this: ARequest : QueryBase<Person, Result>, IJoin<Person, OtherThing> Person has the following field [Ignore] Public string Label { get { return FirstName + LastName; } In my Result i have the following public int Id; public string Label However, if i add an Ignore attribute to...

Serialising XML from database with ServiceStack

c#,xml,json,serialization,servicestack
An application I'm working with has a number of user-defined screens and fields which are stored in a SQL database as XML. I am using ServiceStack to build a web API for use in the application. One of the things I will need to do is to take the user-defined...

ServiceStack's Config.AdminAuthSecret is not working

servicestack
I have a service using the Authorize attribute I would like to use ServiceStack's AdminAuthSecret feature but it isn't working. I have set the AdminAuthSecret as shown below: public void Configure(Container container, IAppHost host) { // more code... host.Config.AdminAuthSecret = "9999"; // more code... } Therefore I have checked out...

How to log a message correlation Id with ServiceStack.Logging ILog?

logging,servicestack,nlog
I'm very satisfied with the current logging solution I have in place right now, which is the ServiceStack Interface being implemented by NLOG. The NLOG targets I am using are as follows: xsi:type="Console" xsi:type="Debugger" xsi:type="File" xsi:type="Seq" of particular importance is Seq which is a log receiver on steroids and my...

ServiceStack versioning - how to customize the request deserialization based on versioning

servicestack
I am working on a new API where we have requirement for many to many versioning. Old Client -> New Server Old Server -> New client and everything in between I've read some of the other posts about defensive programming and having DTOs that evolve gracefully... and we are definitely...

Redirect Legacy Post to ServiceStack API

asp.net,asp.net-mvc,servicestack
I have an ASP.Net MVC site that is running ServiceStack v3.9.71. I have a new ServiceStack API that is configured to be available at ~/api/* but need to redirect POST requests from old locations ~/service/* to the new API however I am coming unstuck. I've tried using url redirects but...

Servicestack Embedding Javascript Resources

razor,servicestack,mef
I have been working on an MEF/Servicestack based framework for an SaaS product. I am compiling razor views into external modules that are loaded during runtime with MEF. I am struggling trying to embed javascript resources into the dlls and then referencing them successfully when the view is loaded. Has...

How to retrieve Data Annotation Alias(“tablename”) and Alias(“field name”) from ServiceStack ORMLite?

c#,servicestack,data-annotations,ormlite-servicestack
I need to return the alias from the Data Annotation of this class "tblAccounts" and "AccountNumber". It uses ServiceStack ORM Lite. [Alias("tblAccounts")] [Schema("task")] public class Account : IHasId<int> { [Alias("AccountNumber")] public int Id { get; set; } [Required] public int UnitId { get; set; } [Required] public int OldAccountNumber {...

npm's less library - how to define a subdirectory for imports

node.js,npm,servicestack
I'm trying to configure the ServiceStack bundler which uses npm's less library. I have a number of subdirectories where I store less files. I have an issue in that changes to my less files are not triggering on compile. They do if I reference the file directly in my bundle...

System.IO.IOException: Too many open files

osx,servicestack,xamarin-studio
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...

How to prevent the logging of a failed request to favorite.ico with ServiceStack

servicestack
This will be the 5th such question that centers around the favorite.ico and ServiceStack webservice framework. I understand the rationale behind logging resource not found, and most of the workarounds use the built-in not found handler e.g. appHost.CatchAllHandlers.Add((httpMethod, pathInfo, filePath) => { if (pathInfo.StartsWith("favicon")) return new NotFoundHttpHandler(); }); but this...

Soap Address Location : ServiceStack SOAP 1.2

soap,wsdl,servicestack
I've been looking around for an answer but I've found nothing that solves my problem, forgive me if this has been asked before. I've got a REST and SOAP API and my problem is that when i add my swdl into SoapUI it opens it up and points to the...

ServiceStack: VS 2012 Add service reference

c#,soap,servicestack
I'm having issues adding a service reference to my soap endpoint. I even tried adding the address for the hello example on SS website, http://mono.servicestack.net/soap11, and couldn't generate the wsdl. All my dtos (on my project) are decorated with data contract/ member. I've also changed the assembly to point to...

What happened to SafeConvertAll in ServiceStack?

servicestack
I am looking at the ServiceStack.UseCases application, specifically the ImageResizer project. The code in Global.asax references an extension method called SafeConvertAll, which does not appear to be a part of SS any longer. What happened to this function and what should I use to replace it? Thanks...

ServiceStack Cannot Set Session with Redis

servicestack,servicestack.redis
I am using the AuthFeature to authenticate my user. I am experience an issue writing to Redis. Has anyone experienced this before? Using ServiceStack 4.0.40 and Redis-64 v2.8.19 installed by Choco // Register the caching container.Register<IRedisClientsManager>(c => new RedisManagerPool(ConfigUtils.GetAppSetting("RedisHost"))); // Host: 127.0.0.1 container.Register<ICacheClient>(c => c.Resolve<IRedisClientsManager>().GetCacheClient()); Response: { "userId": null, "sessionId":...

ServiceStack and Stripe

servicestack,stripe-payments,servicestack-text
I'm using the ServiceStack Stripe package, but it seems the serializer for the GetStripeCustomer method doesn't parse the Subscription Status correctly. In the JSON I can see that the Status is "past_due", but when ServiceStack converts it to StripeCollection the Status value is "Unknown". I'm using ServiceStack.Stripe v4.0.24 Has anyone...

ServiceStack AutoQuery ordering

order,servicestack
I am using AutoQuery which makes writing services very simple. One of my queries needs to order descending by value X and then ascending by value Y. It appears that in AutoQuery you can order everything ascending or descending but not a combination. To get around this I added custom...

In IIS, can I use the same base path for multiple Web API applications?

iis,deployment,asp.net-web-api,servicestack
Is there any way to have multiple, independent iis websites that all use the same URL base path? I have a Web API application that contains http webservices grouped by domain (order, product, shipping, etc...). I want to break those domains into individual API applications so that I can deploy...

How do I access ServiceStack's Service.Db instance from within a RequestFilter?

c#,servicestack,requestfiltering
I have a C# ServiceStack RequestFilter... public class VerifyRequestedSystemsAttribute : Attribute, IHasRequestFilter { IHasRequestFilter IHasRequestFilter.Copy() { return this; } public void RequestFilter(IRequest req, IResponse res, object requestDto) { var systemIds = RetrieveSystemIds(requestDto); Db.Select...? //How do I make Db available for use? } private List<int> RetrieveSystemIds(object requestDto) { // Find the...

ServiceStack Logical Separation of Procedures

web-services,rest,servicestack
I believe ServiceStack is a an exceptional framework that works well toward removing the plumbing that typically goes with web services, that said there is one deficiency that perhaps I just need clarification on. When dealing with a large project, for example with multiple products, it seems like a logical...

ServiceStack user session not found when using sessionId in client Headers or Cookies

client,servicestack,session-cookies
I am using ServiceStack v4 with custom Authentication. This is setup and working correctly. I can call the /auth service and get a returned AuthorizationResponse with unique SessionId. I also have swagger-ui plugin setup. Using it, I can authenticate via /auth and then call one of my other services which...

ServiceStack V4 Basic Auth with wrong credentials + CORS

c#,.net,servicestack,cors
I was trying to enable CORS for ServiceStack V4 project. My plugin configuration is as follows: Plugins.Add(new CorsFeature(allowedHeaders:"Content-Type, Authorization")); I also use HTTP basic auth for authentication: Plugins.Add(new AuthFeature(() => new AuthUserSession(), new IAuthProvider[] { new BasicAuthProvider(), //Sign-in with Basic Auth new CredentialsAuthProvider(), //HTML Form post of UserName/Password credentials }));...

ServiceStack Self Hosting Redirect any 404 for SPA (Url Rewrite)

angularjs,servicestack
I'm using self hosting servicestack for a single page application with mvc and razor. On the same apphost i serve some api. The problem is i need some a 404 redirect to the main path "/" to get html5 mode running in AngularJS. I've tried: DefaultRedirectPath = "/" this.GlobalHtmlErrorHttpHandler =...

Servicestack Services with dynamic data

servicestack
I love Servicestack and have bought the commercial version. I need to provide Rest services based on fully dynamic data that is defined in metadata (in some data store). I therefore know the structure of the data and datatypes but not via a POCO, and in some situations the data...

HttpResult or HttpError with response dto does not get serialized into body

servicestack
i am trying to return a BadArguments Error along with a custom DTO in the body: var result = new HttpResult(response, "application/json", HttpStatusCode.BadRequest); I have tried to use HttpError, HttpResult, setting the response by hand etc etc but i get only HTTP/1.1 400 BadRequest Cache-Control: private Transfer-Encoding: chunked Content-Type: text/html...

Service Stack Redis in Web Api OData add EdmEntityObject / EdmEntityObjectCollection

dynamic,asp.net-web-api,redis,servicestack,odata
We are able to add a normal POCO class to a Service Stack Redis client IRedisTypedClient<Product> objRedisTypedClientNB = redisClient.As<Product>(); IRedisList<Product> objRedisListNB = objRedisTypedClientNB.Lists["Product"]; Product objNews = new Product(DateTime.Now.Ticks.ToString()); objRedisTypedClientNB.Lists["Product"].Push(objNews); Adding products object to redis cache is fine When using dynamic web api odata v4 service, Metadata is created at runtime...

Service Stack set HttpCookie.Secure Flag / Attribute?

servicestack
I'm trying to set the Secure Flag on Session Cookies (ie https://www.owasp.org/index.php/SecureFlag). I've attempted: public override void Configure(Container container) { ... Config.OnlySendSessionCookiesSecurely = true; ... } Without success - when viewing in Fiddler, Chrome Developer Tools, etc - the Secure Flag is not being set. Any help would be appreciated....

How to globally change the command timeout using ServiceStack.OrmLite

servicestack,ormlite-servicestack
I have a reporting-based website using ServiceStack and OrmLite, using a SQL Server back-end. Due to the duration of some of the reports, I'd like to either globally, or selectively (via Service-derived class or some attribute) make queries that run reports have a longer CommandTimeout. I'd like to keep using...

ServiceStack Bundler and sub-directory Less files

css,less,servicestack
Until recentlly I was using the rather awkward dotless. I'm restricted to what I can use somewhat because I'm using VS2010, however I came across ServiceStack Bundler which seems to work great... apart from one thing. My Less files are split using a directory structure - to simplify things, like...

ServiceStack - Redis Sessions Accumulating

redis,servicestack
In AppHost.cs container.Register<IRedisClientsManager>( c => new PooledRedisClientManager(redisConnectionString)); I'm not seeing these sessions getting cleaned up in 30sec. public class MyUserSession: AuthUserSession { public override void OnAuthenticated(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary <string, string > authInfo) { ...do stuff here authService.SaveSession(session, TimeSpan.FromSeconds(30)); } } Am I missing something in the...

Why am I getting 401 responses from my ServiceStack Services when using ServiceStack client

servicestack
I have developed a set of ServiceStack web services which have been working well for some months now primarily from a WPF application which uses the ServiceStack client libraries. Due to some other issues arising with the services with other developers, I decided to look at the requests and the...

How to use InsertOnly method in OrmLite?

servicestack,ormlite,ormlite-servicestack
Following this example, how is the correspondent for the method InsertOnly? var updated = await dbCon.UpdateOnlyAsync(timesheet, onlyFields: x => new { x.LogInTime, x.LogOffTime, x.IsFlaggedByLeader, x.LeaderComment, x.IsModified }, @where: x => x.Id == timesheet.Id) > 0; I couldn't find an example on Internet and in the Ormlite documentation. ...

Servicestack Ormlite seems to be ignoring my Database Schemas c#

c#,sql,servicestack,ormlite-servicestack
Hi folks quick help required if possible i'm trying to do (what i thought would be simple) a quick query. The object i'm using [Schema("Prospect")] [Alias("TrackedSource")] public class ProspectSource { [PrimaryKey] [AutoIncrement] public int Id { get; set; } public int? ClientId { get; set; } public string Name {...

Xamarin.Forms: Call to a API using ServiceStack throws exception

c#,xamarin,servicestack,xamarin.forms
I have a local service made with ServiceStack and I want to call a method from my Xamarin.Forms application: ServiceStack.JsonServiceClient sc; sc = new ServiceStack.JsonServiceClient("http://api.sportsstars.local/"); When the debugger reaches the second line, it throws this exception: System.TypeInitializationException: An exception was thrown by the type initializer for ServiceStack.ServiceClientBase Any ideas what...

return data progressively from ServiceStack API

servicestack
Currently my app returns data by MemoryStream, the problem is the size of data could be large than 500MB, and that takes up much memory before return. I am seeking for a way to return the data progressively. For example, flush the output for every 1MB. First I tried IPartialWriter...

Sql Server query works in management studio but not in C# (ServiceStack.OrmLite)

sql-server,recursion,servicestack
The following recursive query works in SSMS, but not in a C# query in ServiceStack. It boils down to the query (I think)... or the fact that I'm using OrmLite... in SQL Server Management Studio the query works pretty great... it lists the records in a hierarchical (self referencing) table....

Whats the difference between ServiceStack.OrmLite packages and .Signed version?

c#,servicestack,ormlite-servicestack
When download the packages in Visual Studio there are two version of the same packages for ServiceStack. ServiceStack ServiceStack Signed What is the difference?...

How to configure NLog (Servicestack) for Multiple files

c#,servicestack,nlog
I need to save one log file for each of my threads running. So I want different log files, the code below saves one log, but I need to create diferent ones, how can I call the method saying which file I want to save? LogManager.LogFactory = new NLogFactory(); var...

Removing swagger from ServiceStack WSDL

c#,wsdl,servicestack
I have a REST & SOAP API implementation in ServiceStack and I am having a problem with getting rid of Swagger in the WSDL. I have the swagger plugin installed with servicestack with: Plugins.Add(new SwaggerFeature()); I've documented everything rest side that I'm using and the swagger works well. I'm getting...

Thread safety of Service Stack Redis connections

c#,asp.net,redis,thread-safety,servicestack
I've been having some problems with Service Stack recently- I've figured out that it seems to be caused by having multiple threads, each connecting to Redis to perform operations. If I have only one thread running at any one time it works fine, but any more and I get several...

ServiceStack ormlite json does not deserialize from database

c#,serialization,servicestack,ormlite-servicestack,servicestack-text
ServiceStack ORMLite does not deserialize my class from Postgresql. Keeping the objects on cache solves, but it can't load them back (saving is ok). Below is a code that reproduces the problem. void Main() { var inv = new Inventory(); inv.Items.Add(new Item{Id=1,CreatedAt=DateTime.Now, Key="potion10", Descriptions=new Dictionary<int, string>{{1,"Poção que recupera um pouco...

ServiceStack CredentialsAuthProvider is ignore rememberMe = false

servicestack
I am using CredentialsAuthProvider with SS v4.0.39, and have been for well over a year. A client has asked what the "remember me" checkbox on the login page does. My understanding was that this determines whether the user's session is persisted across browser tabs. However, having tested it, when rememberMe...

ServiceStack View 403 (Forbidden)

razor,servicestack,servicestack-razor
I have setup Service Stack web project with a couple of views. I can access the /Default.cshtml view without any problems but when I try to access anything in the /Views/ folder I get the below error: Forbidden Request.HttpMethod: GET Request.PathInfo: /Views/MyView.cshtml Request.QueryString: Request.RawUrl: /Views/MyView.cshtml I have looked at the...

ServiceStack ORMLite - Can't Infer Relationship (because of DTO name?)

servicestack,ormlite-servicestack
I am modeling a service business that performs multiple services at each visit to a client. I have a Visit table, a Service table and a link table, VisitService. I am using this Request DTO in my service to get a list of services for a visit: [Route("/visits/{visitid}/services", Verbs =...

Anonymous object blob in database not serializing as JSON when queried

json,servicestack,ormlite-servicestack
I have a need to store an unknown data structure in a SQL Server database table field via ORMLite. This is to support a timeline feature on a website where each step on the timeline contains different information, and I want to store them as generic "Steps", with the variable...

Potential illegal fragment detected when using OrmLite SqlExpression with Mysql?

mysql,servicestack,ormlite-servicestack
When I try to execute the following line: var vehicles = db.Select<VehicleResponse>(q => q.Select( "SELECT make, model, year, color FROM Vehicles").Limit(skip: 0, rows: 10)); I get the error: Potential illegal fragment detected: SELECT make, model, year, color FROM Vehicles If I execute the following, I don't get the error: var...

ServiceStack Redis latest list by date

c#,model-view-controller,redis,servicestack
If I have a class public class Article { public int Id { get; set; } public string Title { get; set; } public string ShortDesc { get; set; } public DataTime UpateDate { get; set; } } What is the best way of getting list of users from Redis...

Updating Xamarin app with servicestack

xamarin,servicestack
where is IosPclExportClient?? I used to use PclExport.Configure(new IosPclExport()); But I have no idea what happened to IosPclExport - Now I see people are using IosPclExportClient.Configure(); But IosPclExportClient isn't available?! Why does all this have to change all the time?!...

ServiceStack Authenticates both iOS Apps when one is logged in

rest,xamarin,servicestack,restful-authentication,servicestack-auth
I'm using the awesome ServiceStack to implement my REST backend which serves two iPhone apps written in Xamarin. Everything works great but i'm struggling in getting sessions to work correctly when the two apps are installed on the same device ! The issue is that if I login in one...

Passing parameters to HTML (view) outside of DTO

servicestack,servicestack-razor
I've got a service that is used both for JSON and HTML. For the HTML rendering, I need to pass some extra parameters that is not suitable to include in the "common DTO". E.g. which CSS file to use, or other things. For now I've been injecting it into the...

OrmLite: SQLiteExceptionSQL logic error or missing database near “)”: syntax error

c#,sqlite,servicestack,ormlite-servicestack
Hi i'm trying to test out if I delete a parent object, the child will automatically be deleted too using OrmLite and the in-memory database Sqlite this is my test code but it throws me System.Data.SQLite.SQLiteExceptionSQL logic error or missing database near ")": syntax error at the db.Save() line. What...

Retrieve Custom exception message from service layer in ajax call

jquery,asp.net-mvc-5,asp.net-ajax,servicestack
I have developed my application in ASP.net MVC5 using ServiceStack framework. In my app, on button click, I make ajax server call which returns data. this.LoadData = function(){ $.ajax({ url: '@Url.Action("SearchCustomer", "Customer")', cache: false, type: 'GET', contentType: 'application/json', data: { 'IndexNo': this.IndexNo }, success: function (result) { }, error: function...

How do I apply a custom ServiceStack RequestFilterAttribute to an auto-generated Service?

servicestack
I have a custom RequestFilterAttribute that I am applying to my ServiceStack services: [MyCustomAttribute] public class MyService : ServiceStack.Service {... I have recently begun using the AutoQuery feature (which is awesome) but I'm wondering how to apply MyCustomAttribute to the auto-generated services that you "get for free" when your request...

LINQ query fails with nullable variable ormlite

linq,servicestack,ormlite-servicestack
I'm trying to write following LINQ query using ServiceStack Ormlite. dbConn.Select<Product>(p => p.IsActive.HasValue && p.IsActive.Value) Here, Product is my item class and "IsActive" is Nullable Bool property in that class. When this line executes it always throws "InvalidOperationException" with the message variable 'p' of type '' referenced from scope '',...

How to use ServiceStack with Razor on mono

ubuntu,mono,servicestack
I've been following the rockstars razor demo code from ServiceStack and I run into an issue when attempting to run on mono. Self host - runtime views (Razor based pages hang - basic html returned fine) Self host - compiled views - has issues with RazorGeneratorBuildTask on mono build server....

ServiceStack response filter “short circuiting” causing problems

servicestack
We have embraced SS as our REST server platform and love it - one of the recurring issues I face deals with logging requests that have been "short circuited" for one legitimate reason or another (errors, missing mandatory headers, etc). I am finding that I have to add extra logging...

Hide/remove columns from servicestack requestlogger page

servicestack
Is there a way to hide or remove columns from the request logs page (RequestLogger plugin) in ServiceStack? The Form Data and Items columns are never going to be useful for us so displaying them just wastes unnecessary screen real estate....

Return simple raw string in ServiceStack (.NET)

servicestack
For our internal monitoring, our dev ops team asked us to provide a simple endpoint for the bot to hit. Something like: www.domain.com/monitor/check If everything is fine, it should return a raw string, something like "GoodToGo" We have an app currently using ServiceStack and it works fine, but I'm having...

Servicestack reverse routing exception

servicestack
I'm trying to get the absolute url out of a ServicesSatck service but I'm receiving the following exception: None of the given rest routes matches 'SingleUser' request: /user/UserName/{UserName}: Allowed HTTP methods 'Get' does not support the specified 'GET' method. SingleUser class has the following routes declared as metadata : [Route("/user",...

How do I enable HTTP Compression when using servicestack with IIS8

compression,servicestack
I had a project that built on the latest version of servicestack 4. And it seems the response will always not including content-coding:gzip whatever I tried. I've already enabled the dynamic compression on the IIS. Don't know what else to do. Do I need to add something to my coding?...

How to properly register Redis Master and Slaves with ServiceStack Client Managers?

redis,servicestack,servicestack.redis
When I provision a default Redis cluster on Google Compute Engine, there is one master and 2 read-only slaves and Redis Sentinel is running on each machine. Given the previous cluster I'd now like to use this in my ServiceStack Service, but the Sentinel setting has me stumped, typically I...

ServiceStack.OrmLite SqlServer new Merge method doesn't work for different names of references

c#,sql-server,servicestack,ormlite-servicestack
I tried to use the new merge method in ServiceStack.OrmLite Sql Server it works perfectly to load references when the name of the column is the same as the Child Table: var result = dbCon.SqlList<TimeSheet>("EXEC getAllTimeSheets @timeSheetTypeId, @teamId, @employeeId, @fromDate, @toDate", new { timeSheetTypeId, teamId, employeeId, fromDate, toDate }); //...

Cookieless authentication using ServiceStack

asp.net,servicestack,basic-authentication,http-basic-authentication
I am building a REST API using ServiceStackV3 hosted in ASP.NET MVC 4 Project. Want to use HttpBasic Authentication over SSL. I want to achieve the following using ServiceStackV3: Cookieless authentication. API consumers should not have to go to /auth/something to authenticate and come back to /someservice/someaction. Instead they call...

Are ServiceStack's validators instantiated with every new request or is it a Singleton?

servicestack
Are ServiceStack's validators instantiated with every new request or are they instantiated once and reused accross multiple requests (Singleton)?

How does ServiceStack ORMLite handle Many to many relationships?

orm,many-to-many,servicestack,ormlite-servicestack
I am working on an ORMLite demo and so far, it has been doing everything I wanted it to do. However, the production DB against which we are going to work has a lot of many to many relationships where we have a landing table with composite primary key. I...

ServiceStack selfhosting disable caching for memory

model-view-controller,servicestack
Using Selfhosting standard ServiceStack MVC Application every request get cached in the memory. Changing any js file have no conscience until i restart the server. Is there any way around this problem for developing purposes?

How could I add a delay in processing failed messages in ServiceStack Redis MQ

servicestack,mq,servicestack.redis,redismqserver
Is there an easy way to get Servicestack to wait x seconds before retrying a failed MQ item (using Redis MQ). At the moment it just tries 3 times consecutively with no delay.

Servicestack Authentication namespace using SOAP

.net,api,soap,servicestack
I'm getting this error when using SOAPUI to send an authenticate request to my ServiceStack API. Expecting element 'Authenticate' from namespace 'http://schemas.servicestack.net/types'.. Encountered 'Element' &nbsp;with name 'Authenticate', namespace 'http://correctnamespace.com/schemas/2015/05/MyAPI/' Here's my apphost setup: SetConfig(new HostConfig { HandlerFactoryPath = "api", DefaultContentType = "application/json", WsdlServiceNamespace = "http://correctnamespace.com/schemas/2015/05/MyAPI/", DebugMode = false, UseHttpsLinks =...

ServiceStack Is IsDebuggingEnabled in View (HttpContext missing)

asp.net-mvc,servicestack
I'm using ServiceStack. In my layout view i need to know for an condition if the application is debugging or not. For some reason there is no HttpContext. I've tried to install Install-Package Microsoft.AspNet.Mvc. Than Install-Package Install-Package ServiceStack.Mvc. Now i can download localhost but there is no website visible after...

Control ServiceStack deserialization of POST variable and store in object

c#,serialization,servicestack,servicestack-text
I would like to deserialize a post variable using ServiceStack's built in deserialization. But, I would like to make two changes that will provide me with some flexibility for another problem that I am attempting to solve. [Route("/MyObject/{Property}", "POST")] OtherRoutes... public class MyObject:IReturn<MyObjectResponse>{ public string Property{ get; set; } public...

How to handle JSV with a comma(,) containing value?

servicestack,servicestack-text
Assume we have a string as follows: string employeeDetails=[{Id:100,Name:John,Address:#39 ,street ,Country},{Id:101,Name:Brein,Address:#79 ,street ,Country}]; This is how i am Deserialising my string. JsvStringSerializer jsv = new JsvStringSerializer(); List<EmploymentDetails> employmentDetails = jsv.DeserializeFromString<List<EmploymentDetails>>(employeeDetails); As a result i am getting each employee address upto first comman i.e., employeeDetail.Address value as "#39" instead of "#39...

ServiceStack.Text deserialize string into single object null reference

c#,.net,json,servicestack
I have the following code. With JSON.NET it works fine where I can deserialize the string into the CustomMaker object. With ServiceStack.Text I get null. I've tried doing { get; set; } and removing and adding the constructor. With JSON.NET it simply worked like JsonConvert.DeserializeObject(xString); Any idea why this does...

Can I check for the existence of an HTTP only cookie with Javascript? [duplicate]

javascript,authentication,cookies,servicestack,single-page-application
This question already has an answer here: Check if httponly cookie exists in Javascript 1 answer Can I use Javascript to see if an HTTP-only cookie exists, I don't want to see the value, just know whether or not it is there. I need this because I have an...

Download CSV file (UTF 8) encoding ServiceStack

csv,utf-8,servicestack
I am new to ServiceStack. It has feature to provide csv file for the data but I need to download it in UTF8 format because I am getting some special characters. I have tried this config setting. SetConfig(new HostConfig { AppendUtf8CharsetOnContentTypes = new HashSet<string> { MimeTypes.Csv } }); but no...

How to upgrade nuget packages if the installed version is missing?

servicestack,nuget
Running into a situation where I deployed an application to production a few months ago and now I need to do some work on it, on an entirely new machine. The first I do is pull source and nuget restore won't restore because it can't find the particular version of...

ServiceStack authentication with both [Authenticate] and [ValidateApiKey] attributes

authentication,servicestack,api-key
I have some endpoints decorated with the [Authenticate] attribute. Now a third party client has to access the same endpoint by using a shared API key. As the code would be exactly the same for the two cases, I would like to check first if the current request comes from...

ServiceStack 3.9 build warning

.net,servicestack
I get this build warning when I try to build my project: ...\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll : warning CS1684: Reference to type 'ServiceStack.ServiceHost.ApiMemberAttribute' claims it is defined in '...\packages\ServiceStack.Common.3.9.11\lib\net35\ServiceStack.Interfaces.dll', but it could not be found This is my packages.config: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="ServiceStack" version="3.9.71" targetFramework="net40" /> <package id="ServiceStack.Common"...

ServiceStack not rendering Razor View, only seeing Snap Shot

twitter-bootstrap,razor,twitter-bootstrap-3,servicestack,servicestack-razor
I've set up a very basic ServiceStack project with Bootstrap and I'm trying to get it to see my homepage (Razor View) which it doesn't, so I get the Snapshot of my homepage. Here are the steps I take to create the project: Create new Project "ServiceStack ASP.Net with Bootstrap"...

Dynamically creating operations and services in ServiceStack

c#,api,command,servicestack,cqrs
I'm working on a ServiceStack project that requires me to gather a list of commands, of which I have over 200, and create a operation and service for each of them. Essentially I am making a Commanding API which will allow users to send commands without using the UI (exposing...

Convert SQL to ServiceStack.ORMLite Sql Server

c#,sql-server,tsql,servicestack,ormlite-servicestack
How to convert the following SQL to ServiceStack.OrmLite Sql Server format? /* Total Receipts */ select convert(date, t.TransactionDate) [Date], tm.TeamId,a.AccountNumber, count(distinct(t.RequisitionNumber)) Total from task.tblTransactions t inner join task.tblRequisitions r on r.RequisitionNumber = t.RequisitionNumber inner join task.tblAccounts a on a.AccountNumber = r.AccountNumber inner join Team tm on tm.DivisionId = a.DivisionId where...

JsonServiceClient ResponseFilter doesn't trigger

c#,servicestack
Maybe I'm missing something simple, but I can't for the life of me get the ResponseFilter to trigger on a JsonServiceClient in ServiceStack. The RequestFilter triggers every time (I'm sending an API token to my API). Here is a sample console app that shows the ResponseFilter never writing to the...

Ormlite int based enums coming as varchar(max)

servicestack,ormlite-servicestack
Can anyone tell me how to correctly get ORMLite to store enums as integers? I know that this was not supported in 2012 but i found code for some unit tests that suggest it should work now but it doesn't. When we try the column gets created as a varchar(max)...

Post-registration action in ServiceStack

.net,authentication,servicestack,ormlite-servicestack
I have used ServiceStack for a few projects and really love it. That said, this is my first foray into dealing with user auth in any way, so forgive me if I'm making any fundamental errors in my understanding or implementation here. I need to be able to track custom...

servicestack Redis Client AcquireLock TTL has no affect

servicestack,ttl
We are having problem with ServiceStack Redis Client that TTL property is not working as we expect. When we browse redis desktop manager we see that our lock key has no TTL value set. Do you have any recommendation ? Here is the sample code as recommended: using (var redisManager...

ServiceStack Soap 1.2 HTTPS Client

c#,soap,https,servicestack,soap1.2
I have a ServiceStack based Soap Client, which operates correctly for HTTP but when I try to use HTTPS it gives me this error ServiceStack.WebServiceException: The provided URI scheme 'https' is invalid; ex pected 'http'. Parameter name: via ---> System.ArgumentException: The provided URI scheme 'http s' is invalid; expected 'http'....

Swagger url for self hosted servicesteack service

.net,web-services,servicestack,swagger
I am trying to use ServiceStack.Api.Swagger and by default swagger url is pre-populated with /swagger-ui/resources While for self-hosted ServiceStack service it is available right under /resources How can I change routing for self-hosted service for embedded swagger resources or update default swagger url. Routing update is preferable way as it...

Best way to do property level authorization in ServiceStack?

c#,.net,angularjs,entity-framework,servicestack
I'm currently developing a SPA in Angular, and so I've created a REST service using ServiceStack. I am also using ServiceStack's default authentication and authorization solution, which allows me to decorate services with the Authenticate attribute, and also allows me to authorize roles. However, since my application has users, and...

Do the Request filters get run from BasicAppHost?

servicestack
I know that the services get wired-up by instantiating the BasicAppHost, and the IoC by using the ConfigureContainer property, but where is the right place to add the filters? The test in question never fire the global filter: [TestFixture] public class IntegrationTests { private readonly ServiceStackHost _appHost; public IntegrationTests() {...

ServiceStack intercept requests before they are sent client side

servicestack
I have implemented a custom HMAC authentication for servicestack (example shown here). As suggested at the bottom of the link, I wanted to do something like this client side: var client = new JsonServiceClient(); client.LocalHttpWebRequestFilter += delegate(HttpWebRequest request) { // ContentType still null at this point so we must hard...

ServiceStack's fluent validation does not work with the Equals function

servicestack
This snipped works fine: RuleFor(request => request.Id) .Must(id => id == 0) .WithMessage("'Id' must be equal to '0'."); And this one doesn't work (it's just ignored): RuleFor(request => request.Id) .Equals(0) .WithMessage("'Id' must be equal to '0'.")); Am I missing something or is the Equals function erroneous? ...

Retrieve selection of servicestack redis session objects based on values of properties

redis,servicestack,stackexchange.redis,servicestack.redis,servicestack-auth
I want to update multiple servicestack user sessions that are stored in redis. I want to return all sessions that have a custom property set to a certain value, then I can process them. At the moment the best solution I have returns all keys as such: List<string> sessionkeys =...

Send .PDF file generated in memory via Resposne

c#,http,itextsharp,servicestack,httpresponse
So I have problem with Resposne file. I can send some file but it is corrupted. I know my pdf librabry works fine (checked on console app) public void Get(ClaimExportRequest exportRequest) { var str = ExportToPdf(claimDataTable); using (var streams = new MemoryStream(str)) { base.Response.AddHeader("Content-Disposition", "attachment; filename=report.pdf"); base.Response.AddHeader("Content-Length", str.Length.ToString(CultureInfo.InvariantCulture)); base.Response.ContentType =...

ServiceStack cant handle cookie from subdomain angular client

angularjs,cookies,localization,servicestack
I have a problem on servicestack catch client cookie. My Service domain : service.domain.com Website (Angular) : www.domain.com Each one on dedicated server. I developing on Self-Host method in Servicestack 4. Here is my Request Filter looks cookies than if noting than set thread culture. this.PreRequestFilters.Add((httpReq, httpResp) => { var...

ServiceStack Funq Container setting public Members to null

c#,servicestack,inversion-of-control,funq
Some members of our devteam just spent some time debugging a similar issue. A RegisterAs class used in one of our unittests has a public member: public List Mails { get; set; } When this class is resolved through Funq, the member is set to null, even though it is...

servicestack server events with azure RedisServerEvents doesn't work, while default option MemoryServerEvents works

servicestack,servicestack.redis
Question on Servicestack ServerEvents using Azure Redis cache.. Server Code: I have these lines under Configure method of Global.asax file Plugins.Add(new ServerEventsFeature { OnConnect = (res,httpReq) => res.Publish("cmd.onConnect","Message on connect") , OnCreated = (res,httpReq) => res.Publish("cmd.onConnect","Message on create"), ...I have custom message for OnSubscription and OnPublish as well }) **var...

MySQL decimal column precision with Servicestack ORMLite

mysql,servicestack,ormlite-servicestack
I've got a decimal attribute and I'm trying to set the precision and scale to be 12 and 2 respectively. My understanding is that I should just be able to do this by adding the DecimalLength attribute to the property like so: [DecimalLength(12,2)] public decimal? Amount { get; set; }...