SOAP Web Service URL in grails - grails

I am developing a grails webapp and used SOAP to publish my web service using
Endpoint.publish("http://localhost:8080/XYZ", new XYZ());
When I am accessing this service from my local machine then it works fine but when I try to access it through different computer using my machine IP address instead of localhost, it does not show anything.
I have allowed the port through firewall as well but still no success.
Can anyone tell me the reason and how to solve this?

By default embedded tomcat server will listen on localhost. You will have to explicitely bind it to the ip address.
Try this, and see if works
$grails -Dserver.host=192.168.1.100 run-app
Or
$grails -Dserver.host=192.168.1.100 run-war

Related

Cannot load site on localhost with iOS devices on BrowserStack Automate

I'm hosting a .NET Core HTTP application on localhost using Kestrel on an available port for some browser-based UI tests, but when trying to access it using real iOS devices with BrowserStack Automate with BrowserStackLocal.exe, Safari consistently refuses load the page.
I've tried various parts of the IP ranges documented here, but none have been successful. Desktop browsers (Chrome, IE, Edge and Firefox on Windows, Safari on macOS Mojave) and real Android devices work as expected.
I've also tried using the local IP address of the machine and the fully-qualified domain name (FQDN) as described here, but neither work portably as Windows Firewall blocks the connections even through BrowserStack Automate can resolve the address.
Port 80 is not a viable solution as developers' machines will have IIS running on their machines using that port, so it is not available for other purposes.
Given the following constraints, what are the workable solutions?
Hosted on HTTP.
Runs without admin privileges (i.e. no reconfiguring the firewall or using privileged port numbers <1024).
At least two possible port numbers to use so that if one is in use there's at least one alternate to try.
No additional manual setup required to run the tests (should just be the command dotnet test).
On the iOS devices, try resolving http://bs-local.com:5000 instead of http://localhost:5000.
You can access the site using http://bs-local.com:5000, But make sure to disable the host check for webpack using disableHostCheck: true in configuration.
For angular cli users, to disable to the host check you need to use --disable-host-check like ng serve --port 4200 --disable-host-check
This is from BrowserStack's support:
a) On Safari
Previously, accessing local websites with 'localhost/127.0.0.1' in the URL was not supported on iOS devices running iOS versions 10 and above.
However, to make sure that your website loads with 'localhost' in the URL, we now modify the URL to http://bs-local.com on these devices. This helps in loading your website in an expected manner. The same is mentioned here.
In the screenshot you've shared, you can see the redirection to bs-local.com as well.
It seems that your localhost website is configured to be accessible only via specific hostnames such as 'localhost'. Thus, you face the reported error.
To be able to test your localhost website via Safari on iOS devices, I would recommend configuring your localhost website to be accessible via the private IP address of your local machine.
Once done, you can access your localhost website as http://<private_IP_address:port> and this should work.
I would also encourage reading through this guide to understand how you could achieve the above: https://www.notion.so/Testing-localhost-on-iOS-devices-1ceb5e274cee46d7ac538b71304919b4
b) On Chrome
Due to restrictions imposed by Safari, testing localhost websites on Chrome is not supported by default on iOS devices.
The problem arises with the usage of the domain 'localhost'. We are actively trying to find alternatives for this behavior as well.
However, in the meantime, you can access your localhost website via the private IP address as mentioned above via Chrome browser on iOS devices as well.
Once you make the necessary changes to your configuration to allow your localhost website to be accessible via the private IP address, you can test your localhost website via Chrome on iOS as well.
Feel free to reach out should you need any further assistance!
Note: The private IP address is not the same as 127.0.0.1. You can use this article to identify the private IP address of your machine.
Regards,
Reehan
BrowserStack Support
Did you try changing the 'localhost' with the IP address of the machine (where the web is hosted)?
For instance - If the IP for the machine on which application/webpage is hosted is 22.22.22.22, then change http://localhost:3000/index.html to http://22.22.22.22:3000/index.html in your test
They have mentioned the same here - https://www.browserstack.com/question/663
If you are using Angular CLI then please run command
ng serve --host 0.0.0.0 --port xxxx
This will make sure that you would be able to access application using your IP and port specified. Once done you should be able to access your application using browser stack iPhone device browsers using IP and port rather than localhost.

Jenkins Server - Issues with setting URL

I am trying to set up an internal Jenkins server for our QA team and facing some issues with the server URL. This is inside a corporate network and all sort of firewall and proxy settings are in place, however we need to access the server only with in our internal network. This server runs from a Mac Mini. I was able to install and access the server without any issues using localhost:8080.
I tried to set a custom URL (something like testjenkins.local:8080)under the Manage Jenkins option and never was able to access the server. The only option worked for me is with the IP address (IP:8080). I was able to access the server from other machines in the network using this URL.
The real problem with the above setup is that the machine IP changes(I am not able to make it static), and hence wont be able to get an always working URL.
Highly appreciate if any one guide me in the wright direction.
Given you have a dynamic IP on your server, a good alternative would be using ngrok. Ngrok can expose the port 8080 of that server to the internet via secure tunnels, and you can access it via an URL, so changes in the IP won't affect it.
However, ngrok exposes the server to the whole Internet. To make it accessible only for your team you can add authentication in both ngrok tunnel and Jenkins server (would it work for you?).

accessing grails app from external computer

I have Grails web services app running on a Linux VM.
From within the VM, I can use POSTMAN to hit the login service and get credentials.
From outside the VM, I get "This seems to be like an error connecting to http://100.100.100.100:8080/myservice/login. The response status was 0."
I started grails with these paramters:
grails -Dserver.host=xx.xx.xx.xx -Dserver.port=8080 dev run-app
It is a VirtualBox VM and the network is setup to be Bridged.
Any one know how to make my services accessible to other machines?
thanks

Setup server for ruby on rails

working under linux server Centos remotly in local network, my rails server working there too. How can I enable remote web access? And if so how can I enable only couple of ip addresses for web access?
You should check on which addresses the server applications binds. If it has no external IP-Address then it wont be possible to access it directly from the internet. Then it is possible to use port forwarding to forward your application over your router. If you havent any access to the router you should ask the administrator of your network to forward it for you.
Another possibility is to plug a VLAN to a secound interface but you should think about security when you have a server that is connected to your NATed network and the internet directly!
if its only rails production server setup then you can try with this:
http://www.leonardteo.com/2012/11/install-ruby-on-rails-on-ubuntu-server/
it uses https://github.com/ballistiq/ruby-passenger-nginx-installer and they are maintaining the installer. I found its very helpful. it works like no-pain

Accessing running Grails application from a remote machine

I'm developing a Grails application to a school work. Typically, this is the URL for any server running on a local machine:
http://localhost:8080/ProjectName
After I run tomcat server with my Grails project, I go to that location and I can acess the website. But, as far as I know, everyone in my LAN should be able to load the website from same URL (http://localhost:8080/ProjectName). As I have two computers on same lan via router, I tried to acess my website and it doesnt seems to be working. How can access the application from another computer? If possible, suggest a website that I can read and learn stuff about this matter, cause my lack of knowledge about servers is so dramatic.
If you want your local development instance to be available to other machines on your network, start grails like this:
grails -Dgrails.server.host=0.0.0.0 run-app
Then you can get your own IP address from ipconfig or ifconfig as described in another answer. You can then access your application from another machine. Make sure your local firewall is not blocking 8080 (or whatever other port you've decided to start grails on)
You need to use your machine's hostname or IP to access it from another machine.
You can get this information from a command prompt:
Windows
C:\>hostname
yourhostname
C:\>ipconfig
...
IPv4 Address. . . . . . . . . . . : 192.168.x.x
Linux (usually)
$ hostname
yourhostname
$ ifconfig
...
inet.addr:192.168.x.x
You can use either of those to get to it from another machine, e.g.
http://yourhostname:8080/YourApplication
or
http://192.168.x.x:8080/YourApplication

Resources