How to run multiple web APIs from same solution? - visual-studio

I'm trying to run multile Web APIs located in the same solution. One API i can acces with /client/1(project OtherApi) and the other API i call with /customer/1(project ConcurrentAPI). When i run the entire solution only /client/1 is giving me a response and when I try to call /customer/1 im getting an HTTP 404 error(look image).
I have already tried setting both projects as startup projects but this did not work.
Any thoughts?
Thanks in advance!

You try to run two processes that will listen to the same port.
I guess one of them will warn you that the port is busy.
So you may use different port in each solution, and then, access to each API using the appropriate port.

Related

Permissions in Keycloak, where can I allow all clients?

I am new to Keycloak. I have installed a Docker container with Keycloak 19.0.2. Then created a new realm, client and user. As described in various tutorials it says.
Now I tried to connect my Spring Boot application with Keycloak. But I always get the error connection reset.
I have now tested something around and found out something strange.
When I call the URL /realms/rName/.well-known/openid-configuration with Chrome or Edge I see a JSON string, same URL in Firefox I get the error page load error. Also Insomnia gets an error Error: Failure when receiving data from the peer.
I suspect that my Spring Boot application is also getting this. Now where can I set the permissions in Keycloak to allow everyone to talk to the endpoint?
Many greetings
EDIT: Same situation on Root Page. http://localhost:8080/. The Welcome Site is shown on Edge and Chrome but not in Firefox or Insomnia
please excuse my question. I have been able to find the problem. Another process was also listening on the same port. Why there was no error that the port is already in use, I don't know. Now I set Keycloak to another port and it works with all clients. That it is technically possible at all, I wonder, especially why it is program dependent. Well, it works now. Thanks to all who helped.

React native project created by expo how to enable http requests to a server on the localhost

as the title suggests I've used the react native expo quick start guide and managed to setup a basic project. Everything worked just fine until it came to making fetch requests to my local server by laravel 8. It seems both android and ios don't allow making http calls unless you change some config in your android folder which I don't have for using expo. Tried googling for my answer but I keep running into dead ends. Is there any way to enable this or should I try migrating my back-end temporarily to heroku or something similar? Thank you for reading.
Edit: Forgot to mention each time i make a call to the wrong route I immediately get Network error while hitting the right routes throws an unresolved promise

Running an app on Bluemix results in a tunneling socket error

I have added the proxy with an n.p.m installation. However, when I run my app locally it shows this error:
tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 80
What could be the problem? Is it that my added proxy is wrong or is there something else? If it is the former issue, please give me the steps to fix it. Thank you in advance.
I understand you're trying to use the Tradeoff Analytics service. If all you need is a simple proxy, which does not do anything other than forward the \dilemma calls to the service, you might want to consider using the simplified proxy from the new UI's demo page. With this proxy, it's basically a two-liner to set-up a proxy.
To do that, please go to our GitHub project. Here are the steps you need to do in order to use the simple proxy:
Add "http-proxy-middleware": "^0.9.0" to your package.json (this is the only dependency the simplified proxy needs).
Copy the file tradeoff-analytics-proxy.js from our project.
require it in your app.js - see line 20 in the sample app.js
Run it - it will return an Express "middleware" you'll need to send to app.use() - see line 24.
If you're using the Tradeoff Analytics UI Widget, you will need to change the dilemmaServiceUrl to /tradeoff-analytics-proxy/dilemmas. See line 16 of public/index.js.
No need to add a proxy via npm installations. And it definately is the cause for your problem.
It is best to use the app.js provided that essentially acts a proxy for the browser requests to Bluemix

Web API on IIS7.5 Unable to download * from localhost

I'm currently trying to install web api project directly from vs 2013 to my local dev machine, but when I test one of my http get controllers, I get the following:
My url looks like this:
http://localhost:8081/api/Location/States?queryTerm=Ark
When I test this on my local, this url works and I get my json response.
pay no attention to the web config error in the background. If I enter anything invalid, I get an IIS error, so I know I'm hitting the right URL.
Side note: I'm using IE8 for testing.
I found out the solution, and it may be a config thing, but when I made this as an virtual application to a website, this went away, and it gave me a yellow sign of death (which is a good thing). I was able to deduce this to be an oracle issue, where it couldn't find the database connection, and then found out it couldn't resolve tns names.
So I guess Web API can not be hosted by itself on IIS? I haven't looked into it, but it seems this to be the case, unless there needs to be more tweaking involved.
i know too late for response. But i get same error when I try deploy Odata v4 Application in IIS server.
In server , i hit this error as above, i try everything config but nothing change.
At last, i try connect from client and it work.
I recognize that in Client , it download a json file from Server (in case use Odata , it seem like wsdl file in webservice) and API still work well.
For some reason, it cant download in server, but dont worry, it still work.
Hope this helps!

Location of crossdomain.xml Windows Azure

I need to put a crossdomain.xml file in my Windows Azure Web Role. But where ?
I tried to put it in : F:\sitesroot\0
But my Unity3D Web App says : Exception: Unable to connect, as no valid crossdomain policy was found.
I don't know what I am missing. Unity uses by default port (843).
Where to put the crossdomain.xml
Any help is welcome !
CrossDomainPolicy.xml must be at the root of your application.
If you are using single Web Role just add CrossDomainPolicy.xml at the root of your application and set it up correctly as below:
Depends on how many "sites" sections you have in your role's ServiceDefinition.csdef , you will get that many \sitesroot\0 and \sitesroot\1 and CrossDomainPolicy.xml will be distributed to all depend on your role solution settings.
Once I discussed this in my following blog:
Silverlight front end calling to WCF Service, all in one Windows Azure Web Role Sample
You mentioned port 843, which sounds like it would need the Flash protocol, which is a TCP socket listener on port 843 that responds with the cross domain policy when it receives the text <policy-file-request/>. Do you need to be doing that? Does your app use sockets?
Avkash's answer is correct for where the XML file should go if you just need to serve it via port 80 from your web app, but if you need to do raw sockets, you'll need to be running something on the server that handles that.

Resources