3

here is my module in aspBoilerpLate in Application Layer

 [DependsOn(typeof(TransitCoreModule), typeof(AbpAutoMapperModule))]
    public class TransitApplicationModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }

and here is my webapimodule

 [DependsOn(typeof(AbpWebApiModule), typeof(TransitApplicationModule))]
    public class TransitWebApiModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());


            DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(TransitApplicationModule).Assembly, "app")
                .Build();

            Configuration.Modules.AbpWebApi().HttpConfiguration.Filters.Add(new HostAuthenticationFilter("Bearer"));
        }
    }

and here is my AppService

 public class MeetingAppService : TransitAppServiceBase, IMeetingAppService
    {
        private readonly IMeetingManager _meetingManager;
        private readonly IRepository<Meeting.Meeting, Guid> _meetingRepository;
        public MeetingAppService (IMeetingManager meetingManager, IRepository<Meeting.Meeting, Guid> meetingRepository)
        {
            _meetingManager = meetingManager;
            _meetingRepository = meetingRepository;
        }
        public Task Cancel (EntityRequestInput<Guid> input)
        {
            throw new NotImplementedException();
        }

        public async Task Create (CreateMeetingInput input)
        {
            var meeting= Meeting.Meeting.Create(AbpSession.GetTenantId(), input.Subject, input.Title, input.Date, input.StartTime, input.EndTime, input.Secretary, input.Description, input.Agenda);
            await _meetingManager.CreateAsync(meeting);
        }

        public async Task<MeetingDetailOutput> GetDetail (EntityRequestInput<Guid> input)
        {
            var meeting = await _meetingRepository
                .GetAll()
                .Where(m => m.Id == input.Id)
                .FirstOrDefaultAsync();

            return meeting.MapTo<MeetingDetailOutput>();

        }

        public async Task<ListResultOutput<MeetingListDto>> GetList (GetMeetingListInput input)
        {
            var meetings = await _meetingRepository.GetAll()
                .WhereIf(!input.IncludeCanceledMeetings,m=>!m.IsCancelled)
                .ToListAsync();


            return new ListResultOutput<MeetingListDto>(meetings.MapTo<List<MeetingListDto>>());

        }
    }

when i want to access http://localhost:6634/api/services/app/meeting/Create i get error 500 message=An error has occurred. i cant find a way to debug it how can i debug this ?

Arash
  • 2,639
  • 4
  • 25
  • 43

2 Answers2

0

If you are pasting this url in the browser, then you're attempting to get to the api services using a GET request. The ABP api uses POST requests by default.

I suggest you try the Postman Chrome Extension to debug the api.

Jacques Snyman
  • 3,699
  • 1
  • 23
  • 44
-1

Sometimes it does not understand that the request comes from a valid source.

Please try below code in service:

[AbpAuthorize]

public class MeetingAppService : TransitAppServiceBase, IMeetingAppService
goto
  • 7,020
  • 10
  • 40
  • 50