使用ServiceStack (v 5.5.0),我读到了通过控制器调用服务的推荐方法是使用网关。完整示例可在https://github.com/RhysWilliams647/ServiceStackControllerTest上找到 public class HomeController : ServiceStackController
{
public ActionResult Index()
{
var response = Gateway.Send<TestServiceResponse>(new Tes
我正在使用ServiceStacks身份验证机制创建一个MVC3站点。当我将AuthenticateAttribute添加到控制器时,我得到一个空引用异常:
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=ServiceStack.FluentValidation.Mvc3
StackTrace:
at ServiceStack.Mvc.ExecuteS
给出以下ServiceStack控制器
public class MyController : ServiceStackController
{
public ActionResult Index()
{
return View(Cache.GetAllKeys());
}
}
和下面的测试类
[TestFixture]
public class MyControllerTests
{
[Test]
public void Should_call_cache()
{
var controller = new M
在使用RazorFormat插件时,是否存在未处理异常的内置呈现程序?
我们的服务正在抛出一个异常,但是ServiceStack仍然呈现相应的Razor视图(只是空数据)。我原以为Razor会在ResponseStatus属性中提取错误并显示类似ASP.NET的YSOD。
编辑:我们的DebugMode on HostConfig设置为“true”。
我有一个自定义的网关过滤器工厂来检查请求是否有效或者抛出一个异常,我有一个ErrorWebExceptionHandler来处理这个异常。 我已经读过Forbid Unauthenticated requests in Spring Cloud Gateway了,我在我的ErrorWebExceptionHandler中尝试过: // error body is some Object
exchange.getResponse().setStatusCode(HttpStatus.BAD_REQUEST);
exchan
ServiceStack方法TypeSerializer.DeserializeFromString中似乎存在一个关于可空类型的错误。
这是众所周知的问题吗?有解决办法还是解决办法?
考虑下面的代码,它包括一个JsConfig作用域,它强制对任何反序列化错误抛出异常:
public class MeasurementsData
{
public int? FlowLeft { get; set; }
public int? FlowRight { get; set; }
public Single? RatioLeft { get; set; }
public
我正在使用xunit运行测试。一个接一个地工作很好,但是一旦我在并行服务栈中运行它们,就会抛出异常。
System.IO.InvalidDataException : ServiceStackHost.Instance has already been set (BasicAppHost)
at ServiceStack.ServiceStackHost.Init() in C:\BuildAgent\work\799c742886e82e6\src\ServiceStack\ServiceStackHost.cs:line 175
appHost = new BasicAp
我的mvc项目中有ServiceStack,并且我正在尝试在ServiceStack和ASP MVC之间共享会话。我按照中的所有步骤共享会话,但是当我尝试在asp mvc控制器中获取UserSession的值时,它显示空VAUE...why is Null?我有这个代码
AppHost.cs
{
ControllerBase<CustomUserSession>
public class CustomUserSession : AuthUserSession
{
public string CustomProperty1 { get; se
我切换到使用ServiceGateway从我的ASP.net控制器中执行请求。以前我只能用Catch (WebServiceException ex)将调用包装在Try catch块中,现在异常被抛出为innerException为WebServiceException的AggregateException。
try
{
var request = new GetRequest();
var response = HostContext.AppHost.GetServiceGateway(HostContext.GetCurrentRequest()).Send(requ
我正在尝试在MonoDroid项目中使用ServiceStack进行Json序列化/反序列化。
我已经构建了ServiceStack来在MonoDroid环境中运行它,但是现在我在JSON反序列化方面遇到了问题。
示例代码:
public class Track
{
public string Id { get; set; }
public string Title { get; set; }
public string Artist { get; set; }
public string Hash { get; set; }
我最近注意到我们的一个应用程序中有一个奇怪的行为。 Exception=System.InvalidCastException: Unable to cast object of type 'System.Data.SqlClient.SqlTransaction' to type 'System.Byte[]'.
at ServiceStack.Text.Pools.BufferPool.GetCachedBuffer(Int32 minSize) in C:\BuildAgent\work\912418dcce86a188\src\ServiceSt
使用ServiceStack和不同的IOC容器LightInject,而不是默认的,我需要注册什么才能使依赖类(ServiceStackController、服务等)获得正确的网关。
示例:
LightContainer.Register<ServiceStack.Web.IServiceGatewayFactory>(x => new ApiServiceGatewayFactory(), new PerRequestLifeTime());
LightContainer.EnableMvc();
//later
public class HomeController :
我们将ServiceStack用于基于REST的服务已经有一段时间了,到目前为止,它是令人惊叹的。
我们所有的服务都是这样写的:
public class MyRestService : RestService<RestServiceDto>
{
public override object OnGet(RestServiceDto request)
{
}
}
对于每个DTO,我们都有响应等价对象:
public class RestServiceDto
{
public ResponseStatus ResponseStatus {get;set;}
最近,我开始开发一个Service开源项目。昨天,我通过了10次免费操作的限制:
The free-quota limit on '10 ServiceStack Operations' has been reached.
Please see https://servicestack.net to upgrade to a commercial license
我的工作假设是开放源码项目有一个例外:
也许我对这个许可证的解释是不正确的。
简单地说,对于希望使用ServiceStack v4 (或其他自由和开放源码软件项目)的开源项目,FOSS异常是如何工作的?我需要购买执照
如标题所示,我们目前正在与抛出异常的ServiceStack v4.0.44 SOAP服务()进行斗争。
XmlException: The input document has exceeded a limit set by MaxCharactersInDocument.
... stacktrace cut down for brewity ...
File "ServiceStack.Text.XmlSerializer" line 33 in Deserialize(System.String xml, System.Type type)
File "Ser
我使用的是有效的许可证密钥。但是我不断地发现这个错误:
ServiceStack.LicenseException : The free-quota limit on '10 ServiceStack Operations' has been reached. Please see https://servicestack.net to upgrade to a commercial license or visit https://github.com/ServiceStackV3/ServiceStackV3 to revert back to the free Servi