Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何打开JAX-WSSOAP服务的TCP端口?_Java_Linux_Soap_Tcp_Jax Ws - Fatal编程技术网

Java 如何打开JAX-WSSOAP服务的TCP端口?

Java 如何打开JAX-WSSOAP服务的TCP端口?,java,linux,soap,tcp,jax-ws,Java,Linux,Soap,Tcp,Jax Ws,我使用javax.xml.ws.Endpoint发布我的服务: Endpoint.publish(“http://localhost:8080/myService“,新的MyServicePortImpl()) 为了测试该服务,我通过curl发送了一个pingxml。当我在本地运行它时,它可以正常工作,但当我从另一台机器尝试curl时,它会失败 curl:(7)无法连接到[MY_SERVER]端口8080:超时 这使我相信端口8080有问题。当我在RHEL机器上运行ss-lntu时,我看到: t

我使用javax.xml.ws.Endpoint发布我的服务:

Endpoint.publish(“http://localhost:8080/myService“,新的MyServicePortImpl())

为了测试该服务,我通过curl发送了一个pingxml。当我在本地运行它时,它可以正常工作,但当我从另一台机器尝试curl时,它会失败

curl:(7)无法连接到[MY_SERVER]端口8080:超时

这使我相信端口8080有问题。当我在RHEL机器上运行
ss-lntu
时,我看到:

tcp侦听0 50::ffff:127.0.0.1:8080:::*


我觉得这是不对的。我认为应该是类似于
::8080
的东西。为什么端口会出错?如何修复它?

通过在iptables中添加允许端口8080的所有入站流量的规则,解决了超时问题。在此之后,操作失败,出现“连接被拒绝”。要使服务侦听所有IP地址,端点需要如下所示:

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