servicestack

Servicestack server sent events

妖精的绣舞 提交于 2019-12-07 21:21:55
问题 I just started messing with my own implementation of ServiceStack server events. After reading the wiki section and reading the code of the chat application, I started creating my own new mvc4 project and installing all the ServiceStack libraries via nuGet. After configuring and creating the AppHost , I created a new "helloworld" service and started the site, just to make sure it worked (it worked indeed). Now the main issues. Based on the existing example code (the chat application), I

Service Stack Serialization Exception for soap 1.1

我的梦境 提交于 2019-12-07 20:14:26
The Request Message: <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendGetAccountNotification xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="mynamespace"> <getAccountResponse xmlns:d2p1="mynamespace"> <d2p1:Account> <d2p1:BusOpsDesc>String</d2p1:BusOpsDesc> <d2p1:ExternalAccountID>String</d2p1:ExternalAccountID> </d2p1:Account> <d2p1:ExternalAccountID>String</d2p1:ExternalAccountID> <d2p1:Message>String</d2p1:Message> </getAccountResponse> <

Is it possible to inject an instance of object to service at runtime

别说谁变了你拦得住时间么 提交于 2019-12-07 18:52:23
问题 I have created a plugin which inspects a param in the query string and loads up a user object based on this ID and populates any request DTO with it. (All my request DTO's inherit from BaseRequest which has a CurrentUser property) public class CurrentUserPlugin : IPlugin { public IAppHost CurrentAppHost { get; set; } public void Register(IAppHost appHost) { CurrentAppHost = appHost; appHost.RequestFilters.Add(ProcessRequest); } public void ProcessRequest(IHttpRequest request, IHttpResponse

Is it possible to create a cross-database query with ServiceStack ORMLite?

為{幸葍}努か 提交于 2019-12-07 18:42:04
问题 Pretty much summed up in the title. Trying to hit a table in one database and join it to a table in another database on the same server. I would have assumed an attribute for Database that I could decorate the POCO with, but do not see one that would be appropriate. Currently using this syntax: var result = db.Select<Model.Dto>( db.From<Data.Dto1>() .Join<Data.Dto2>(d1, d2) => d1.Id == d2.Id)); 回答1: There's no specific attribute for specifying an external database but in RDBMS's that support

How to send commands using ServiceStack?

不问归期 提交于 2019-12-07 18:28:17
问题 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

ServiceStack JsonServiceClient OnAuthenticationRequired

我只是一个虾纸丫 提交于 2019-12-07 18:09:27
问题 This is the very first post on StackOverflow, so please be patient if am doing anything wrong. I am using ServiceStack to create RESTful webservices. While developing a sample windows client I have found the JsonServiceClient.OnAuthenticationRequired property, but was unable to get it working. I have found no documentation about it - and I am assuming that this is a delegate method to supply user credentials when the authentication is required by the server - but I have not been able to get

Make ORMLite use proper serialization for structs

偶尔善良 提交于 2019-12-07 17:13:46
问题 tl;dr: I am registering a serializer and a deserializer on a struct. The serializer is not called, but the deserializer is. How can I fix this? It works properly on reference types, and doing JsConfig<Position>.TreatValueAsRefType = true; did not help either. Long version: I am storing two complex types using ORMLite: Position (a struct, from external library DotSpatial which we do not control) and Tuple. In order to be able to properly store/read them from the database, I defined their

ServiceStack.Text Deserialize json to object always converts to string and behaves strangely with quotes

最后都变了- 提交于 2019-12-07 16:23:10
问题 What I'm trying to do: I have json objects that have values which could be string, ints, doubles, or lists of any of these. I'm trying to deserialize these json strings into C# objects, but because they could have multiple types, I'm stuck using the generic object, rather than a strongly typed alternative. My issue: It appears as though the ServiceStack.Text.JsonSerializer.DeserializeFromString(jsonString) function behaves oddly in cases where T = object. It will always treat things as a

Service Stack (REST) SOAP and WSDL not working

感情迁移 提交于 2019-12-07 14:42:38
问题 I implemented ServiceStack Hello World ,every thing is ok,except one important thing. its SOAP11 and SOAP12 and also WSDL not working. when accessing url http://localhost:8082/SOAP11/ for SOAP11 or SOAP12 it says : { "ResponseStatus":{ "ErrorCode":"NotImplementedException", "Message":"The method or operation is not implemented.", "StackTrace":" at ServiceStack.WebHost.Endpoints.Support.EndpointHandlerBase.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\

How to LeftJoin to the same table twice using ServiceStack OrmLite?

*爱你&永不变心* 提交于 2019-12-07 14:29:40
问题 I have table structures that look like below: table Tenant: Id[PK], etc table Contact: Id[PK], FirstName, LastName etc table Sale: Id[PK], TenantId[FK], SellerId[FK], BuyerId[FK], etc SellerId is a FK to Contact.Id BuyerId is a FK to Contact.Id TenantId is a FK to Tenant.Id I want to use OrmLite to generate SQL similar to below: select sale.* , buyer.FirstName 'BuyerFirstName' , buyer.LastName 'BuyerLastName' , seller.FirstName 'SellerFirstName' , seller.LastName 'SellerLastName' from sale