0

I publish my service using javax.xml.ws.Endpoint:

Endpoint.publish("http://localhost:8080/myService", new MyServicePortImpl());

To test the service, I'm sending a ping XML via curl. This works correctly when I run it locally, but fails when I try curl from a different machine.

curl: (7) Failed to connect to [MY_SERVER] port 8080: Timed out

This leads me to believe that there is a problem with port 8080. When I run ss -lntu on my RHEL machine, I see:

tcp LISTEN 0 50 ::ffff:127.0.0.1:8080 :::*

This looks wrong to me. I think it should be something like :::8080 instead. Why is the port messed up and how do I fix it?

1 Answers1

0

The timeout was solved by adding a rule in iptables to allow all inbound traffic for port 8080. After this, the operation failed with "connection refused." To make the service listen for all IP addresses, the endpoint needs to look like this:

Endpoint.publish("http://0.0.0.0:8080/myService", new MyServicePortImpl());

Solution found here.