调用跨主机SOAP UI Mock服务遇HTTP 404错误求解决方案
It’s super frustrating when local calls work flawlessly but remote ones throw errors—let’s walk through the most common fixes for your scenario:
1. Verify Basic Network Connectivity from the Linux Server
First, confirm your Linux server (x.x.x.10) can actually reach the Mock host (DXXXX221):
- Run
ping DXXXX221from the Linux terminal. If you get no response, either the hostname isn’t resolving or there’s a network routing issue. - If ping works, check if port 9090 is open with
telnet DXXXX221 9090ornc -zv DXXXX221 9090. A "connection refused" message means the port is blocked or the Mock service isn’t listening on it.
2. Fix Hostname Resolution
The error often pops up because the Linux server can’t translate DXXXX221 to its actual IP address:
- Check if the hostname resolves with
nslookup DXXXX221ordig DXXXX221. If these return no results, try one of these:- Add an entry to
/etc/hostson the Linux server: Open the file withsudo nano /etc/hostsand add a line like[IP_of_DXXXX221] DXXXX221(replace[IP_of_DXXXX221]with the real IP of your Mock machine). - Ask your network admin to add a DNS record for
DXXXX221so all machines can resolve it automatically.
- Add an entry to
3. Check Firewall Rules (Both Machines)
Firewalls are the #1 culprit for this kind of issue:
- On the Mock host (DXXXX221):
- If it’s Windows: Go to Windows Firewall settings, create an inbound rule to allow traffic on port 9090 for the SOAP UI process.
- If it’s Linux: Run
sudo iptables -Lto check if port 9090 is open. If not, add a rule:sudo iptables -A INPUT -p tcp --dport 9090 -j ACCEPT.
- On your Linux server (x.x.x.10):
- Make sure outbound traffic to port 9090 isn’t blocked. Run
sudo iptables -L OUTPUTto verify, or temporarily disable the firewall (only for testing!) to rule it out.
- Make sure outbound traffic to port 9090 isn’t blocked. Run
4. Ensure the Mock Service Listens on All Interfaces
By default, SOAP UI might bind your Mock service only to localhost (127.0.0.1)—that means it’s only accessible from the same machine, not your Linux server:
- Open SOAP UI, navigate to your Mock service’s settings.
- Look for the "Host" field: Change it from
localhostto0.0.0.0(listens on all network interfaces) or the actual IP of DXXXX221. - Restart the Mock service, then confirm on DXXXX221 with
netstat -anp | grep 9090—you should see0.0.0.0:9090instead of127.0.0.1:9090.
5. Double-Check the Endpoint URL
Small typos can break everything:
- Ensure your Linux app is using exactly
http://DXXXX221:9090/(no extra slashes, no misspellings in the hostname or port). - Test the endpoint directly from the Linux server with
curl http://DXXXX221:9090/—this will show you the exact response and help you tell if the issue is with the app or the network.
6. Rule Out Proxy Interference
If your Linux server uses a proxy, it might be routing the request incorrectly:
- Run
echo $http_proxyandecho $https_proxyto see if any proxies are set. - If they are, add
DXXXX221to theno_proxyenvironment variable, or temporarily unset the proxies to test the connection.
Start with these steps—chances are it’s a hostname resolution or firewall issue. Let me know if any of these fix your problem!
内容的提问来源于stack exchange,提问作者Rajeswari Reddy

