servicestack

ServiceStack Javascript JsonServiceClient missing properties

廉价感情. 提交于 2019-12-02 14:41:33
问题 I am trying to connect to a JWT authenticated service using the Servicestack JsonServiceClient, however the Docs only describe how to do this using the C# client: http://docs.servicestack.net/jwt-authprovider In these docs, it indicates there should be a BearerToken property on the client like so: var client = new JsonServiceClient(baseUrl) { BearerToken = jwtToken }; However this seems to be missing on the Javascript Client. How can I assign the jwtToken when using the Javascript client? I

ServiceStack - roles and permissions

…衆ロ難τιáo~ 提交于 2019-12-02 14:11:51
问题 I'm implementing ServiceStack's Roles and Permissions. I send {"UserName":"JASON1","Permissions":["CanAccess"],"Roles":["Admin"]} via http://localhost:15465/api/json/reply/AssignRoles but i got following error: { "AllRoles": [], "AllPermissions": [], "ResponseStatus": { "ErrorCode": "Invalid Role", "Message": "Invalid Role", "StackTrace": "[AssignRoles: 3/11/2015 11:12:02 PM]:\n[REQUEST: {UserName:JASON1,Permissions:[CanAccess],Roles:[Admin]}]\nServiceStack.HttpError: Invalid Role\r\n at

Razor dependency issues in ServiceStack 4

隐身守侯 提交于 2019-12-02 11:37:37
问题 I'm trying to upgrade an app to ServiceStack 4 but I'm getting an error with the reference to System.Web.WebPages.Razor in Web.config : Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0 , Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. The offending reference is the exact same that is included in various ServiceStack examples: <compilation targetFramework="4.5" debug="true"> <assemblies> <add

ServiceStack: Self-Host LiveReload not working

我是研究僧i 提交于 2019-12-02 11:14:29
问题 I have a self hosted ServiceStack application which I intend to use to develop an angular application with. The problem is, previously, every time I've made a change to a static file, I've had to restart all the services for it to pick up the changes. I'm wondering if I'm missing something? I've enabled the LiveReload option from RazorFormat but it doesnt seem to have done anything? I still have to restart the whole application for it to pick up changes? I've created a small repro here: https

What is the recommended way to do partial updates with PATCH in ServiceStack?

不问归期 提交于 2019-12-02 08:53:36
问题 I am building a RESTful API using the ServiceStack framework. A lot of the resources that I need to update are quite big, with up to 40 attributes per class, so I would like to do partial updates instead of replacing the entire resource. Often the client will only need to update one or two attributes out of the 40, so I would like to just send a JSON body consisting of the few attributes. Since all combinations of attributes are possible, it is not feasible to make an "Update" class per class

Why does ToOptimizedResult throw “Requested feature is not implemented.” on Mono?

て烟熏妆下的殇ゞ 提交于 2019-12-02 08:46:19
问题 I am building my ServiceStack 4.0.8 service using Visual Studio. On Windows everything works perfectly, but when I try to run on Mono 2.10.8.1 / Ubuntu 13.10 with NGINX 1.4.1 and fastcgi-server4. I get an exception: The requested feature is not implemented. at System.Web.HttpContextWrapper.GetService (System.Type serviceType) [0x00000] in :0 at ServiceStack.Host.RequestPreferences.GetWorker (System.Web.HttpContextBase context) [0x00000] in :0 at ServiceStack.Host.RequestPreferences.get

ServiceStack - how to disable default exception logging

僤鯓⒐⒋嵵緔 提交于 2019-12-02 07:10:38
In line with the ServiceStack documentation , we have a global service exception handler. The docs say that this handler should log the exception then call DtoUtils.HandleException , like this: private object LogServiceException(object request, Exception exception) { var message = string.Format("Here we make a custom message..."); _logger.Error(message, exception); return DtoUtils.HandleException(this, request, exception); } This results in the error being logged twice, since DTOUtils.HandleException also logs it , in a less customised format. Yes, I much prefer this to the DTOUtils logging

RefreshToken undefined after successful Authentication ServiceStack

房东的猫 提交于 2019-12-02 06:54:17
ServiceStack Version 5.0 ServiceStack Typescript Client Version 0.0.40 The following code calls my Auth microservice and successfully authenticates a user and returned there bearer token: var request = new Authenticate(); request.provider = "credentials"; request.userName = userName; request.password = password; request.useTokenCookie = true; this.client.post(request) .then(res => { if (res.bearerToken != null) { console.log('auth success', res); console.log('auth refresh token', res.refreshToken); resolve(true); } resolve(false); }, msg => { console.log('log in failed'); reject(msg); }) The

RefreshToken undefined after successful Authentication ServiceStack

女生的网名这么多〃 提交于 2019-12-02 06:53:43
问题 ServiceStack Version 5.0 ServiceStack Typescript Client Version 0.0.40 The following code calls my Auth microservice and successfully authenticates a user and returned there bearer token: var request = new Authenticate(); request.provider = "credentials"; request.userName = userName; request.password = password; request.useTokenCookie = true; this.client.post(request) .then(res => { if (res.bearerToken != null) { console.log('auth success', res); console.log('auth refresh token', res

How to assign default value to a property

試著忘記壹切 提交于 2019-12-02 06:50:17
问题 CustomerService is a webservice and it is getting called successfully but I am unable to access SelectCommand in the Any method. I think I am missing something here, could anyone suggest. public class CustomerService : Service { private readonly IDbConnection _dbConnection; // injected successfully public ServiceCommand SelectCommand {get;set;} public CustomerService(IDBConnection dbConnection) { _dbConnection = dbConnection; } public Customer Any(CustomerRequest request) { //_dbconnection is