Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include followings:
- ABP Framework version: v4.4.4
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): Tiered / MVC / Identity Server
I am getting an error in the browser when trying to call the API via the Dynamic Javascript Client Proxy. Below are screenshots for my service contract interface, implementation of that interface and the javascript file that refers to the api service and the error in the browser that I am getting when trying to use this api proxy.
Can you see from this what the issue might be? The last time this happened it seemed to be related to a naming convention of my namespace I was using but I have tried it using many ones at this point and I'm still getting the error.
Thanks
16 Answer(s)
-
0
hi
You must make sure the
Abp/ServiceProxyScript
is loaded before you call the proxy js. -
0
How do you mean? How do I do that?
For some reason the only way I can make the javascript call to my 'applicationservice' is to define a controller for it that injects the application service and calls the method I want.
The ServiceProxyScript when I view it in the browser does not include any of my solutions application services that I've created and that implement the IApplicationService interface.
-
0
-
0
Hi,
Understood, but I am using the lepton theme that is provided by Volvo/ABP and have not modified the placement of where this is loaded. The lepton theme's code defines where this reference is placed.
-
0
Can you share a project that reproduces the problem? liming.ma@volosoft.com
You can create a brand new via ABP CLI.
-
0
I have created a new solution using ABP Suite 5.1.2 and adding the Lepton theme module as a project (using ABP Suite) and adding my Company 'application service'. Run a migration to create the database, and then run the tiered projects. Select from the left nativation menu 'System' and then 'Company Maintenance'.
The page should call my company application service 'CompanyHostAppService' method of 'GetCompanyListAsync' but instead it gets a similar error to the one shown in this thread.
The Git repo for this same is below and you should have received an invite to the repo.
https://github.com/spospisil/ABPSampleServiceError
-
0
Hi,
Have you had a chance to take a look at this yet?
-
0
hi
I will check it today, sorry for the delay.
-
0
Hi,
Thank you. Much appreciated.
-
0
https://github.com/spospisil/ABPSampleServiceError/pull/1
-
0
Hi,
I don't understand. Why is a controller necessary? Based on the documentation link below if you create the application service according to what the documentation shows, you don't need a controller.
Please advise.
https://docs.abp.io/en/abp/4.4/API/Auto-API-Controllers
-
0
Why is a controller necessary?
You are using the tiered project, but enable the
Auto API Controllers
in HttpApi.Host project.https://docs.abp.io/en/commercial/latest/startup-templates/application/solution-structure#tiered-structure https://github.com/spospisil/ABPSampleServiceError/blob/0030129afd2120f96cee177503836bd8274da5c3/aspnet-core/src/StructureWeb.HttpApi.Host/StructureWebHttpApiHostModule.cs#L113
-
0
What are you suggesting I need to do in order to not need a controller to call an application service method? Are you suggesting I remove the conventionalcontrollers.Create line of code? Again, this was a out of the box solution generated by ABP Suite and I did not add this line of code myself.
- My question, still, is how do I get javascript to call the methods on my application services WITHOUT creating a controller as the ABP documentation says I can do? If you could update the sample I have on github that shows how that is accomplished it would be much appreciated.
-
0
You are using the tiered project, I suggest you create the controller manually. https://github.com/spospisil/ABPSampleServiceError/pull/1
-
0
Hi,
As highlighted below, the ABP Framework documentation does not not exclude a tiered solution from this framework feature. Could you please updated your documentation accordingly so that other customers do not waste their time exploring how to do this as the documentation does not indicate that this only works for a non tiered solution?
Thanks.
-
0
hi
We will keep improving the documentation. Thanks