Replies: 2 comments
-
Is it possible that you are running Oqtane in Render Mode Static or with server side interactivity? In that case, if you have an service implementation in both client and server, it will use the server one. That might be why it is bypassing the controller. |
Beta Was this translation helpful? Give feedback.
-
As @mdmontesinos mentioned above, please see the "Services" section in this blog: https://www.oqtane.org/blog/!/83/oqtane-developers-meeting-mar-2024 . Oqtane uses dependency injection to determine the most high performance method for components to interact with backend services. If you are running Static Blazor or Blazor Server then there is no need to incur the extra overhead of spinning up an HttpClient to make an HTTP call over the wire with serialization/deserialization of the data. |
Beta Was this translation helpful? Give feedback.
-
Issue: API Controller Not Being Triggered in Oqtane Module
Context:
I am developing a custom Oqtane module where a Razor component calls a client-side service, which should send a request to an API controller. The expected flow is:
1️⃣ Razor Component (Edit.razor) → Calls a method that invokes the client service.
2️⃣ Client Service (InvoiceService) → Sends an HTTP POST request to the API controller.
3️⃣ API Controller (InvoiceController) → Processes the request and performs necessary operations.
However, during debugging, I noticed that the flow never reaches the API controller. Instead, the execution bypasses the controller entirely and directly interacts with the repository layer.
Request for Guidance:
1- What could cause the API controller to be skipped entirely, with execution going straight to the repository?
2- Are there specific configurations required in Oqtane to ensure the client-side service correctly calls the API?
3- How can I confirm whether the HTTP request is being made, and if not, what might be blocking it?
i am using Oqtane Version: 5.1.2
![image](https://private-user-images.githubusercontent.com/10667609/411564365-657d59ef-764a-4b44-9199-3f572989059f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDIwMTcsIm5iZiI6MTczOTYwMTcxNywicGF0aCI6Ii8xMDY2NzYwOS80MTE1NjQzNjUtNjU3ZDU5ZWYtNzY0YS00YjQ0LTkxOTktM2Y1NzI5ODkwNTlmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2NDE1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwYzliZDI3Y2VjOTI1N2NlZWFlMmQ5NjU2NWJjNDMxYmY1NzI4MzE2MjIxZmViN2I4NmNmYTk2OTlhOWRmMDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Y3pz8059Uc4Orfi1XT55v5IxQeq38ygDQAmR-mYKn2A)
Working on multimodule, all compiled finally into three dll (client,server,shared).
Beta Was this translation helpful? Give feedback.
All reactions