servicestack

ServiceStack.OrmLite: StringLengthAttribute.MaxText produces “LONGTEXT” - how can I set to “TEXT”?

早过忘川 提交于 2019-12-11 21:11:41
问题 Using ServiceStack's OrmLite and decorating a Property with the following attribute, creates a column of type LONGTEXT, instead o TEXT as noted in the docs: But it becomes LONGTEXT: I tried setting the StringLenghtAttribute to something else, 65535 , 70000 , Int32.MaxValue etc, but it either interpretet it as a VARCHAR and gave me the Column length too big or Row size too large , or it became a LONGTEXT. Question is: how can I force it to become "TEXT" (or any other text type in mysql)? I

ServiceStack authentication in tests

被刻印的时光 ゝ 提交于 2019-12-11 19:55:54
问题 I want to be able to test my Servicestack endpoints using basic or credentials auth but don't want to have to login for each test, save the ss-id and then use that to actually exercise the end point. Ideally I would be able to create a user using something like (this already works using credentials auth) http://devapi.someapi.com/register?username=blah&password=test&x-http-method-override=POST then actually hit a secured url with something like: http://devapi.someapi.com/users/123?username

Why doesn't ServiceStack always link UserAuth and UserAuthDetails?

时光怂恿深爱的人放手 提交于 2019-12-11 19:32:18
问题 I am struggling with something that I would have thought ServiceStack would do "out of the box"... I have a ServiceStack API that allows authentication via credentials, basic, google OpenId and LinkedIn OAuth2. Starting with empty UserAuth and UserAuthDetails table I have found that if I: start my app and use credentials to log in log out log in using Google OpenId auth ServiceStack creates two separate UserAuth records rather than linking the Google UserAuthDetail with the Credential

File deserialization with ServiceStack's TypeSerializer

佐手、 提交于 2019-12-11 19:04:19
问题 I use ServiceStack.Text as JSON library in my C# project and I'm trying to deserialize a string from file using it's TypeSerializer.DeserializeFromString . I have the following code: async public static void TryLoad(Action<JsonArrayObjects> Ok, Action<string> Fail, string key, int offset) { try { var folder = ApplicationData.Current.LocalFolder; var stream = await folder.OpenStreamForReadAsync(key); var result = await new StreamReader(stream).ReadToEndAsync(); Debug.WriteLine(result); var

ServerEvents - Last message not being recieved until heartbeat

扶醉桌前 提交于 2019-12-11 14:32:34
问题 Extension on : Original post We are having an issue where the last message sent over server events is not being revieved until the next heartbeat. The client in question is using the Service Stack Typscript Client Here is a stripped down implimentation of the server setup / calls As suggested in the original post, we have upgraded to 5.7 AND switched over the the async api and it still waits for the next heartbeat. The c# implimentation for a this works without the delay against the same

ServiceStack SOAP Error serialization

浪子不回头ぞ 提交于 2019-12-11 14:23:42
问题 In a ServiceStack project I've added api key authorization as follows this.RequestFilters.Add((req, res, dto) => { var apiKey = req.Headers["X-ApiKey"]; if (apiKey == null || !ApiKeyValidation.VerifyKey(apiKey)) { throw HttpError.Unauthorized("Unknown ApiKey"); } }); When accessing the service via REST I get a response as I expect: { "ResponseStatus": { "ErrorCode": "Unknown ApiKey", "Message": "Unknown ApiKey" } } When accessing the SOAP 1.2 endpoint, I get an HTML response from the IIS

ServiceStack ORMLite - How to Select All to match the request DTO's properties automatically

↘锁芯ラ 提交于 2019-12-11 13:54:35
问题 I have several ServiceStack ORMLite POCO, one is Company below. public class Company { [AutoIncrement] public int id { get; set; } public string company { get; set; } public int? companyNo { get; set; } public bool? active { get; set; } } If two properties are valid in the following request: req.company="ABC Company", req.active=ture, and all other properties are null. Then it can return all records matching the two properties. The code may look like below: public object Get(Company req) {

ServiceStack Razor files in separate project

半城伤御伤魂 提交于 2019-12-11 13:32:29
问题 I have a solution consisting of a ServiceStack back-end, with the regular setup (AppHost, ServiceInterface and ServiceModel), and both a winforms app and a iOS app consuming services. Now I'd like to make a web-admin, and am looking for advice on how to structure this . I'd like to keep the apphost project small, as SS docs say Ideally the root-level AppHost project should be kept lightweight and implementation-free. So I'd like to have the web-admin in a separate project , with all the

Service Stack 4.0.15: Razor Partial not outputted inside @section

﹥>﹥吖頭↗ 提交于 2019-12-11 12:54:15
问题 Summary: Razor Partials don't get rendered inside a @section in ServiceStack 4. This seems to be a bug in ServiceStack.Razor. Version: ServiceStack 4.0.15 Affected Package: ServiceStack.Razor Razor partials inside a section does not get rendered. Example Inside _Layout.cshtml @RenderSection("JavascriptConfig", required: false) Inside home.cshtml @section JavascriptConfig { @Html.Partial("_routes", Model.Lang) } Inside _routes.cshtml @model string test If I look at the source code of the

How can I make ServiceStack v3 conform to jsonapi.org standards?

心已入冬 提交于 2019-12-11 12:26:24
问题 I am attempting to utilize an Ember.js front-end with a ServiceStack v3 backend. The issue I'm running into is that Ember Data is expecting JSON as per the jsonapi.org standards like so: [{"clients": [ {"clientID":80,"name":"Test Client 6","acronym":"TCL6","website":"http://www.tcl6.com"}, {"clientID":81,"name":"Test Client 7","acronym":"TCL7","website":"http://www.tcl7.com"} ] }] But ServiceStack serializes the data into the following: [{"ClientID":80,"Name":"Test Client 6","Acronym":"TCL6",