Hi,
I need to expose my app's application layer as WebApi. App is being hosted on Azure.According to the doc,I don't have to do anything.B'cos configuration is already there as like this:
//Automatically creates Web API controllers for all application services of the application
DynamicApiControllerBuilder.ForAll<IApplicationService>(typeof(IPApplicationModule).Assembly, "app").Build();
Q 1 : I have tried to accsess web api as shown below.But it doesn't work.Hope I have done some fundamental thing wrong.Can you tell me how to sortout this issue ?
http://MyApp.azurewebsites.net/api/services/app/getAllStatusesAsync
It gives this message :
{
message: "No HTTP resource was found that matches the request URI 'http://MyApp.azurewebsites.net/api/services/app/getAllStatusesAsync'."
}
Q 2 : If I change the above web api's app
name to island
then do I need to do any changes on Angular side or any other place ?
Q 3 : Can you tell me how to secure the web api service ?
This is the doc which I went through : [http://aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API])
4 Answer(s)
-
0
Hi,
"http://MyApp.azurewebsites.net/api/services/app/getAllStatusesAsync" has missing application service name? What is your app service name? If it's StatusAppService, then your url must be "http://MyApp.azurewebsites.net/api/services/app/status/getAllStatusesAsync"
If you are using [AbpAuthorize], then your service is already secured. See here to understand how to access it from a 3rd party application using token based auth: <a class="postlink" href="https://www.aspnetzero.com/Documents/Development-Guide#token-based-authentication">https://www.aspnetzero.com/Documents/De ... entication</a>
-
0
Hi,
Thanks a lot.It's working now. Can you tell me is there any method/tool to document this dynamic web api's methods which I have written ?
-
0
Have you tried swagger (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Swagger-UI-Integration">http://www.aspnetboilerplate.com/Pages/ ... ntegration</a>)
-
0
Hi,
Excellent..Thanks a lot friend :D