servicestack

ServiceStack Routing does not work with querystring

拟墨画扇 提交于 2019-11-27 05:33:56
问题 I have a simple REST service built with ServiceStack. If I configure the routes like this: //register user-defined REST-ful urls Routes .Add<Contact>("/Contacts") .Add<Contact>("/Contacts/{ContactId}") This request succeeds. http://<server>:59557/Contacts?ContactId=9999 //Works If I configure the routes like this (Business Analyst prefers the generated metadata) //register user-defined REST-ful urls Routes .Add<UpdateContact>("/UpdateContact", "PUT") .Add<CreateContact>("/CreateContact",

How to register multiple IDbConnectionFactory instances using Funq in ServiceStack.net

你。 提交于 2019-11-27 05:25:44
问题 How would you go about registering diferent IDbConnectionFactory instances in Funq and then access them directly within your services? Do named instances somehow come into play here? Is this the best approach to take when using different databases across services? Thanks! EDIT: An example ;). I could be way off here because I'm pretty new to IoC, but say for example I have 2 separate database connections that I'd like to inject. In ServiceStack, this is done in the Global.asax. container

“No 'Access-Control-Allow-Origin' header is present” for redirected request to https://login.microsoftonline.com/

本秂侑毒 提交于 2019-11-27 04:53:47
问题 I'm trying to get response with an access code and getting: XMLHttpRequest cannot load "h...://login.microsoftonline.com/d331431b-899c-4666-8094-e82e6bfc3964/oaut…auth%2faad&scope=user_impersonation&state=033f4ad89a574135884fd3a03c1743ab". No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:23589' is therefore not allowed access. Used all suggestions from the ServiceStack, CORS, and OPTIONS (No Access-Control-Allow-Origin header) discussion:

How to implement Delete service call using ServiceStack

做~自己de王妃 提交于 2019-11-27 04:31:59
问题 I have couple of questions related to REST service implementation using ServiceStack. For GET operation, I define my request DTO as below : [Route("/Customer/{ID}", Verbs = "GET")] public class GetCustomer : IReturn<GetCustomerResponse> { .... .... } Here "GetCustomer" is request DTO and "GetCustomerResponse" is response DTO. But for PUT/POST/DELETE operation, I just need to know whether operation got committed successfully or not and if 'not' then what is the exception. So what should be my

Can ServiceStack Runner Get Request Body?

↘锁芯ラ 提交于 2019-11-27 03:22:14
问题 Is it possible, without major hackery, to get the raw request body of a ServiceStack request within the Runner? I am writing an oauth service provider to run on top of ServiceStack using the new API (Service and Runner). Due to how OAuth signing works I need to get the raw request body for each request. The OAuth protection layer is added to the Runner so that an invalid OAuth request can easily return an empty/error response without any boilerplate in the Service class or subclassing a

Multiple Optional Parameters with ServiceStack.Net

╄→尐↘猪︶ㄣ 提交于 2019-11-27 03:16:15
问题 I'm trying to implement a service with Multiple Optional Parameters using ServiceStack.Net At the moment my route looks like this Routes.Add<SaveWeek>("/save/{Year}/{Week}"); I want to support uris like this: /save/2010/12/Monday/4/Tuesday/6/Wednesday/7 ie Monday=4, Tuesday=6 and Wednesday=7 However I want the ability to ignore days i.e. the person calling the service can decide if they want to save each value for each day... i.e. Like this with missing parameter values ?Monday=4&Wednesday=7

ServiceStack web services security

前提是你 提交于 2019-11-27 02:23:08
问题 Hi I am new to working with Servicestack and have downloaded their very comprehensive bootstrapapi example and am working with it, but am still having some issues. The issue is with security, what is happening is I am getting 405 errors when trying to access the protected services. Using the authenticate service it appears that I am authenticating correctly. Please help and explain. Here is the code: public class Hello { public string Name { get; set; } } public class AuthHello { public

ServiceStack - Is there a way to force all serialized Dates to use a specific DateTimeKind?

我只是一个虾纸丫 提交于 2019-11-27 01:52:42
问题 I have a POCO like this: public class BlogEntry { public string Title { get; set; } public DateTime Date { get; set; } } Most of the time it's being hydrated from Entity Framework, but it can and will be used outside of Entity Framework. The DateTimeKind for the Date from EF is Unspecified, which from what I read is normal. When I cache this POCO in Redis (using the ServiceStack Redis client), it comes back with a DateTimeKind of Local. So there is a jitter with the returned objects. The

REST actions and URL API design considerations

假如想象 提交于 2019-11-27 00:15:29
问题 I'm building a inventory management system and I'm busy designing (thinking) of the API and my REST implementation. I have the following resources and on the resource you can perform many actions/operations. Each operation will modify the resource and in some cases create a new resource and also create history or transactions. I'm looking for some input from experts in regards to useability and acceptability in regards to URL and resource design. The gotchas and real world examples, any

ServiceStack: RESTful Resource Versioning

↘锁芯ラ 提交于 2019-11-26 23:44:45
I've taken a read to the Advantages of message based web services article and am wondering if there is there a recommended style/practice to versioning Restful resources in ServiceStack? The different versions could render different responses or have different input parameters in the Request DTO. I'm leaning toward a URL type versioning (i.e /v1/movies/{Id}), but I have seen other practices that set the version in the HTTP headers (i.e Content-Type: application/vnd.company.myapp-v2). I'm hoping a way that works with the metadata page but not so much a requirement as I've noticed simply using