Base solution for your next web application

Activities of "jaq316"

For anyone that wants to do the same... Here is the solution:

  1. Create the filter class:
public class PlainTextResponseActionFilter : ActionFilterAttribute, IActionFilter, IFilter
    {

        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            var abpAjaxContent = actionExecutedContext.Response.Content as ObjectContent<Abp.Web.Models.AjaxResponse>;
            if (abpAjaxContent != null)
            {
                var previousValue = abpAjaxContent.Value as Abp.Web.Models.AjaxResponse;
                actionExecutedContext.ActionContext.Response.Content = new StringContent(previousValue.Result.ToString());
            }
            else
                base.OnActionExecuted(actionExecutedContext);
        }

    }
  1. Reference the class in the WithFilters method of the DynamicApicontrollerBuilder
DynamicApiControllerBuilder
                .For<ISomeAppService>("app/some")
                .ForMethod("Process")
                .WithVerb(Abp.Web.HttpVerb.Get)
                .WithFilters(new PlainTextResponseActionFilter())
                .Build();

40 views but no response?

I have an application service that is called by an external service and this service requires the response to be a specific XML format. How can I add a custom action filter to return the correct XML response?

My code currently looks like this:

DynamicApiControllerBuilder
                .For<ISomeAppService>("app/some")
                .ForMethod("Process")
                .WithVerb(Abp.Web.HttpVerb.Get)
                .WithFilters(/* ??? How do I modify the response using a custom action filter? *?)
                .Build();

Yes. I have.

I've implemented an application service in a separate project (not the Application project). I've added the following code to the WebApi Module's Initialize method.

DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(WMSPanelModule).Assembly, "wmspanel")
                .Build();

I can call the application service successfully using the api url (/api/wmspanel/), but the auditing is not wired up on methods in the application service. I must be missing something, somewhere, but I just don't know what.

Any help will be greatly appreciated.

How would one go about registering a new tenant and an admin user for the newly created tenant in the same application service?

The idea is to have a registration form that will allow new users to choose a tenancy name (subdomain) and enter the admin username and password to be used as the admin user for the new tenant.

Question

I'm stuck trying to unit test my AngularJS controllers and I have no idea how to mock the AbpServiceProxies that are auto generated by Abp. Any pointers?

Showing 1 to 7 of 7 entries