try
{
var q = HostContext.ServiceController.Execute(loginDTo, Request);
log.Debug(q);
}
catch (Exception e)
{
}
try
{
var q = Gateway.Send(loginDTo);
log.Debug(q);
}
catch (Exception e)
{
}
I use above code in my service,
on my test, ServiceController.Execute
will never throw exception and wrap inner exception into a httperror class instance,
Gateway.Send
invoke ServiceController.Execute
and wrap result by TResponse ConvertToResponse<TResponse>(object response)
so like code in AuthenticateService
if (isHtml && request.provider != null)
{
if (alreadyAuthenticated)
return this.Redirect(referrerUrl.SetParam("s", "0"));
if (!(response is IHttpResult) && !string.IsNullOrEmpty(referrerUrl))
{
return new HttpResult(response) {
Location = referrerUrl
};
}
}
``
it return HttpResult
instance without Response
prop and ConvertToResponse
will return null,
so Gateway.Send
return null and I don’t know what happened?
simply, ServiceController.Execute
return a HttpResult
instance without Response
prop,
Gateway.Send
return null when it invoke ConvertToResponse