servicestack

servicestack webservice testing with SOAPUI

南楼画角 提交于 2019-12-02 02:10:55
问题 I have created a service using Service Stack and would like to test it using SOAPUI. When I setup the SOAPUI project with the soap12 wsdl url [ http://<developmenturl>/soap12 ], I keep getting the below error : Mon Mar 13 15:14:29 GMT 2013:ERROR:Could not find element [{http://schemas.servicestack.net/types}<requestDTOobject>] specified in part [parameters] Initially I had the DTO under a different name space, due to the above error message I changed the DTO object to be in the same namespace

servicestack webservice testing with SOAPUI

有些话、适合烂在心里 提交于 2019-12-02 01:38:15
I have created a service using Service Stack and would like to test it using SOAPUI. When I setup the SOAPUI project with the soap12 wsdl url [ http://<developmenturl>/soap12 ], I keep getting the below error : Mon Mar 13 15:14:29 GMT 2013:ERROR:Could not find element [{http://schemas.servicestack.net/types}<requestDTOobject>] specified in part [parameters] Initially I had the DTO under a different name space, due to the above error message I changed the DTO object to be in the same namespace as the service but still I get this error. I have pasted below the request generated: <soap:Envelope

ServiceStack using DotNetStandard Service Model in .Net framework web project

别等时光非礼了梦想. 提交于 2019-12-02 01:27:04
We recently created a new DotNetCore web service using ServiceStack. The ServiceModel project is a DotNet Standard class library v2.0. I am getting compiling errors while referencing the new ServiceModel from our existing web services that were written in DotNet Framework 4.6.1. Looks like by referencing the new ServiceModel, it is pulling in ServiceStack.Interfaces.Core which conflict with ServiceStack.Interfaces already referenced in the DotNet Framework project. We are not looking to upgrade those existing services to DotNetCore yet. Is there a way to consume a DotNet Standard ServiceModel

ServiceStack - Authentication for domain and subdomains

妖精的绣舞 提交于 2019-12-02 01:08:20
问题 I want to host the ServiceStack authentication providers on the root of a domain (domain.com) and have the authentication work for the entire domain (sub1.domain.com, sub2.domain.com). Is it possible to replace the default implementation of ICookies with my own so I can set domain in the cookies? I am seeing that HttpResponseWrapper instantiates the default implementation so I am guessing no. Is there another approach? 回答1: I addressed my issue with the following pull request. In Web.config,

ServiceStack API documentation in Swagger-UI behind the closed doors

元气小坏坏 提交于 2019-12-02 00:26:45
问题 I want to allow access to swagger-ui and metadata only if user is authenticated (forms auth) on our web app, but I want to allow API access all the time (API have some public methods and some which require basic auth). So what I did is I added this route prefix for API: public override RouteAttribute[] GetRouteAttributes(Type requestType) { var routes = base.GetRouteAttributes(requestType); routes.Each(x => x.Path = "/API" + x.Path); return routes; } And: ServiceRoutes = new Dictionary<Type,

What's the best way to respond with the correct content type from request filter in ServiceStack?

≡放荡痞女 提交于 2019-12-01 21:39:16
ServiceStack services are great for responding with the content type that's requested in the Accept header. But if I need to close/end the response early from within a request filter, is there a way to respond with the proper content type? All I have access to in a request filter is the raw IHttpResponse so it seems to me that the only option is to tediously, manually check the Accept header and do a bunch of switch/case statements to figure out which serializer to use and then write directly to the response.OutputStream . To further illustrate the question, in a normal service method you can

ServiceStack API documentation in Swagger-UI behind the closed doors

眉间皱痕 提交于 2019-12-01 21:33:49
I want to allow access to swagger-ui and metadata only if user is authenticated (forms auth) on our web app, but I want to allow API access all the time (API have some public methods and some which require basic auth). So what I did is I added this route prefix for API: public override RouteAttribute[] GetRouteAttributes(Type requestType) { var routes = base.GetRouteAttributes(requestType); routes.Each(x => x.Path = "/API" + x.Path); return routes; } And: ServiceRoutes = new Dictionary<Type, string[]> { { typeof(AuthenticateService), new[] { "/api/auth", "/api/auth/{provider}" } }, } And this

ServiceStack - Authentication for domain and subdomains

懵懂的女人 提交于 2019-12-01 20:53:17
I want to host the ServiceStack authentication providers on the root of a domain (domain.com) and have the authentication work for the entire domain (sub1.domain.com, sub2.domain.com). Is it possible to replace the default implementation of ICookies with my own so I can set domain in the cookies? I am seeing that HttpResponseWrapper instantiates the default implementation so I am guessing no. Is there another approach? I addressed my issue with the following pull request . In Web.config, you can specify the domain for your cookies. ServiceStack was overwriting this value, but now ServiceStack

Configure ServiceStack.Text to throw on invalid JSON

独自空忆成欢 提交于 2019-12-01 19:27:54
问题 Is it possible to make the ServiceStack.Text library throw when attempting to deserialize invalid JSON. By default it looks as if invalid JSON is just ignored, so that the result object contains null values. When I attempt to deserialize this json (a " is missing after MongoConnectionString) { "MongoDb": { "MongoConnectionString:"mongodb://localhost:27017/x", "MongoDatabase":"x", "MongoSafeModeEnabled":true, "MongoSafeModeFSync":true, "MongoSafeModeWriteReplicationCount":

ServiceStack AppHostHttpListenerBase Unable to connect to the remote server

六眼飞鱼酱① 提交于 2019-12-01 19:01:02
I'm working through some Functional Tests on my app, and I think I'm getting pretty close. My problem is that when I run my first test, I get the error. unable to connect to the remote server. Expected: OK But was: 0 I can confirm that if I put a breakpoint on the Assert, and then try to hit the BaseUrl in my browser, it is not found. Here's my test. [Test] public void MyTestTest () { var client = new RestClient( ServiceTestAppHostBase.BaseUrl ); // client.Authenticator = new HttpBasicAuthenticator( NUnitTestLoginName, NUnitTestLoginPassword ); var request = new RestRequest( "/users/", Method