Configuring WebAssembly with Multiple Proxy Endpoints #1783
-
My team is developing a Blazor WebAssembly app utilizing Csla. We've developed a NuGet package that retrieves configuration information from a database. These objects were also written utilizing Csla. How do configure the web assembly app to call different data portal endpoint for the different libraries? Am I going about this wrong? Any help would be appreciated. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 3 replies
-
Of course, the next few searches I do after posting this question led me to http://www.lhotka.net/weblog/CSLANETVersion49NewFeatures.aspx. I'm reading it now and hope this answers my question. |
Beta Was this translation helpful? Give feedback.
-
So, in the end, I decided it would be best to use the server-side dataportal routing vs having the client call a bunch of different services. I've done what I think I need to do from what I can glean from your blog post (http://www.lhotka.net/weblog/CSLANETVersion49NewFeatures.aspx). Unfortunatly, when I click my button, nothing happens. No network activity at all. No errors messages in the console. Nothing. In an effort to troubleshoot, I've removed the server dataportal's routing info and the DataPortalServerRoutingTags from my root business objects.. If the DataPortalServerRouting tag is present, then nothing happens. If I remove it, things work. An example business object tag: An example route I'm using in the client's server's dataportal constructor: The client blazor app has nothing special in it. Any suggestions? Thanks for any help. |
Beta Was this translation helpful? Give feedback.
-
I figured it out. The article had "routingTag- - a routing tag is specified, but no version". I took that to mean I needed to put "search-" in the DataPortalServerRoutingTag. I took out the dash and things started working. I wish I would have seen an exception of some sort. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to bug you again. Do you have an example of two services running in k8s with a blazor webassembly calling a dataportal that's routing to another service's dataportal? |
Beta Was this translation helpful? Give feedback.
-
It doesn't seem to be routing :( Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
The controller that is being called by my blazor webassembly client looks like:
The Root object I'm trying to call has been affixed with |
Beta Was this translation helpful? Give feedback.
-
When I look at the output from the Console.Writes, I see: PostAsync - 10/6/2020 9:03:59 PM - 'fetch/search-' for the client data portal. The Search dataportal is never called. |
Beta Was this translation helpful? Give feedback.
-
I'm so glad I can look at the code! Turns out the RoutingTagUrls needed a dash in the key: I had I also placed the RoutingTagUrls in a static 'constructor' vs the instance constructor. Thanks for listening! |
Beta Was this translation helpful? Give feedback.
I'm so glad I can look at the code!
Turns out the RoutingTagUrls needed a dash in the key:
I had
RoutingTagUrls.Add("search", "http://search/api/dataportal");
vs
RoutingTagUrls.Add("search-", "http://search/api/dataportal");
I also placed the RoutingTagUrls in a static 'constructor' vs the instance constructor.
Thanks for listening!