I am using asp.net web api service in ionic. But its not getting service data in real device - asp.net

I am using angular Httpclient to call asp.net web api in ionic application all working fine its getting data from service in localhost:8200 but when it comes to real device the service response with error

Problem Solved: Basically you need to change the url on your project where you do service. Change it from localhost:3000 to 10.0.2.2:3000. The 3000is the port's number, it doesn't need to be 3000. Then you open android studio, open emulator and run it. On the litle tab right next to the android device, theres 3 dots at the end. Press those, then go to settings, and change proxy to 10.0.2.2 and the port number to the one you are using, in this case is 3000. After that it will work. Sorry for late update on the problem!
For more info:
why do we use 10.0.2.2 to connect to local web server instead of using computer ip address in android client
If you are behind a proxy, download an APP called pulseSecure log in, and it should be good to go.

Related

Web Api can't handle this request in production

I have noticed that over the last year while my app has been in production, it sometimes just switches off.
When I debug the web api project locally and use the connection string of the database on Azure, it works.
Whenever I then publish the project to Azure, it says Error 500, can't handle this request. Even with the connection string hard coded in the appsettings.json.
What I did notice though was when I changed firewall settings on the database server recently, that's when it switched off. I don't know if that's the source.
What could the problem be?
And would you think it, it was the server IP address.
I had to find the virtual IP address of the web app under Properties in the left pane and add it to the server rules of the database.

Unable to connect to webservice using Chrome Advanced REST Client but able to connect through chrome browser

I need to connect to a third party webservice. When I hit the link directly in the chrome browser, I am able to connect to it and I get a response. But when I tried the same using Advanced REST Client app of chrome, I get a message as 'The service's server DNS address could not be found.'
Also, when I tried to connect it via my JAVA code, using spring's rest template, am getting an Unknown host exception. What could be the reason that am able to connect via browser but not otherwise?
Thanks in advance.
Maybe it's a problem with your system's DNS settings? I'm not sure how Chrome handles queries to DNS when primary DNS did not found the record. If it uses Google DNS' then Chrome may connect to the service but other applications can't.
To test it set your DNS to 8.8.8.8 and check if apps start working.
From browser it's working properly but not from rest client or application, then i guess the problem with the proxy.
if you are using your office network, then this issue will come.
Try hitting the webservice by connecting to personal network.
i have faced similar issue last week, from browser and postman i'm able to hit the web service but not from the application.
Ones i connected with my personal then it started working.
Hope it helps.

Meteor iOS app issue with AirWatch VPN Tunneling

We have developed a mobile app using Meteor+Ionic2. We use our internal NodeJS server which is not in internet zone. We got the app deployed to our enterprise app store which enables AirWatch VPN tunneling to get the access to server in intranet zone.
Everything works great when tested with iOS device level using "F5 Access" VPN when deployed using Xcode or enterprise app store with NO VPN tunneling . But when download the app from our enterprise app store which does per-app VPN using AirWatch VPN Tunneling, iOS app gets stuck at the splash screen. It is not seems to call any client side or server side code of Meteor+Ionic2.
When redeploying it using development distribution, It seems to be stays at about:blank and not going to localhost and getting "Failed to load resource" error in about:blank.
The same AirWatch VPN Tunneling works great in Android. This issue seems to be happening only in iOS. I checked device level logs and also AirWatch VPN tunnel logs which donesn't report any errors.
I'm not sure whether Meteor+Ionic2 supports AirWatch VPN Tunneling for iOS as none of framework codes get called. Is there anyway to debug the enterprise distributed app? Is VPN-Tunneling not supported in iOS app development using Meteor?
Thanks,
Annadurai.
The root cause of the issue seems to be AirWatch config which causes the localhost to be appended with domain name like localhost.mycompany.com. As AirWatch couldn't fix this issue, we dropped plan of using AirWatch VPN tunneling.

Connect to Local Webservice from Mobile app

I need to make an application where a mobile web app can connect to a local web service in a LAN. For example, several locations are running this web service on their own local server. When someone with the mobile app comes into the location they can open it up and it will somehow be able to connect to that local webservice through WiFi. The mobile app won't know the IP of that webservice ahead of time. Any thought on how to go about this? This will be a .NET webservice and HTML5 app but I don't think that matters.
As mentioned in the comments you will probably have to make it configurable by the user as the will ultimately need the address of the server.
There is however another approach that you can take. Develop a small multicast/udp service that broadcasts the web service address every 10-30 seconds. In your android application register a broadcast receiver that responds to the network connectivity status and runs in the background.
This service on the Android service will pick up the address from the UDP broadcasts and then configure the application.

ASP.NET network issue

So i want to to create a web application using asp.net to connect to another application (for example a simple windows form) using sockets. The problem is i'm behind firewall and i don't have the authority to mess with the firewall settings, what other options can i do besides sockets?
My application is fairly simple, the web application will be hosted on the internet and has a "connect" button, when its click it establish connection with the windows form that is on another computer and display the message "Connected" if its connected. All this will be tested behind some kind of corporal firewall. How do i get around this?
The firewall is there specifically to stop this kind of thing.
The bestway around it would be to have the Forms app poll the server for connectivity - this can be made to look near real time by making the server receive the request, then wait until it gets a connect action, or time out after a few minutes and return nothing. Then the forms app would request again.
I think instead of using directly a web application, you should look forward to create a web service to solve both the purposes. You can have its reference in both of them. your Web Form will make a request to connect to the web service instead of application. That will solve both purposes.

Resources