WebService:Firefox 无法与 192.168.10.203:8080 的服务器建立连接

发布于 2024-09-03 06:45:29 字数 1027 浏览 4 评论 0原文

我正在尝试创建一个网络服务。我无法访问该 URL。如果我尝试连接,

http://192.168.10.203:8080/EchoBeanService/EchoBean?wsdl

则会收到错误:

Firefox can't establish a connection to the server at 192.168.10.203:8080

但是,如果我能够使用 URL 中的 localhost 连接到:

http://localhost:8080/EchoBeanService/EchoBean?wsdl 

Echo.java

package services;

public interface Echo {
    public String printEcho();
    public String printEchoParam(String str);

}

EchoBean.java 封装型号;

import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import services.Echo;

@Stateless
@WebService
public class EchoBean implements Echo {
public EchoBean(){}
@WebMethod
    public String printEcho(){
        return "WebServices Echo ";
    }
@WebMethod
    public String printEchoParam(String str){
        return ("In PrintEcho( String " + str +" )" );
    }
}

-H

I am trying to create a WebService. I am not able to access the URL. If I try to connect to

http://192.168.10.203:8080/EchoBeanService/EchoBean?wsdl

I get an error:

Firefox can't establish a connection to the server at 192.168.10.203:8080

However, if I am able to connect to the using localhost in the URL:

http://localhost:8080/EchoBeanService/EchoBean?wsdl 

Echo.java

package services;

public interface Echo {
    public String printEcho();
    public String printEchoParam(String str);

}

EchoBean.java
package model;

import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import services.Echo;

@Stateless
@WebService
public class EchoBean implements Echo {
public EchoBean(){}
@WebMethod
    public String printEcho(){
        return "WebServices Echo ";
    }
@WebMethod
    public String printEchoParam(String str){
        return ("In PrintEcho( String " + str +" )" );
    }
}

-H

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

遗忘曾经 2024-09-10 06:45:29

我对 java 完全一无所知,但这种症状似乎并不是 Web 服务所特有的。也许与此 java 应用程序或默认仅绑定到 localhost:8080 或监听 localhost:8080 的服务器有关?也许这将有助于改变这一点:如何更改 webservice url 端点?

类似说明,特别是“部署 Web 服务”部分:http://today.java.net/article/2006/06/12/web-services-made-easy-jax-ws-20

否则,就像上面的人所说:检查您的本地防火墙以查看传入连接是否被阻止,或验证分配给运行此服务的系统的 IP 地址。

I have absolutely no knowledge of java, but this symptom doesn't seem all that unique to web services in general. Maybe something to do with either this java app or the server by default binding only to or listening at localhost:8080? Maybe this would help to change that: How to change webservice url endpoint?

Similar instructions, specifically the 'Deploying the Web Service' section: http://today.java.net/article/2006/06/12/web-services-made-easy-jax-ws-20

Otherwise, like folks said above: check your local firewall to see if incoming connections are blocked, or verify the IP addressed assigned to the system this service is running on.

み格子的夏天 2024-09-10 06:45:29

检查以下内容:

  • 192.168.10.203 是您的 IP 地址吗?
  • 您的相应网络接口(192.168.10.203 的接口)上是否有可能阻止连接的防火墙?

Check the following:

  • Is 192.168.10.203 your IP address?
  • Do you have any firewall on the appropriate network interface (the interface of 192.168.10.203), that might block the connection?
爱你是孤单的心事 2024-09-10 06:45:29

此外,出于安全原因,某些应用程序服务器默认禁用远程连接。您的服务器可能必须设置为允许远程连接。

您可以使用 telnet 连接到端口来检查网络连通性。

telnet 192.168.10.203 8080

Also some application servers disable remote connections by default for security reasons. Your server might have to be setup to allow remote connections.

You can check network connectivity by using telnet to connect to the port.

telnet 192.168.10.203 8080
瑶笙 2024-09-10 06:45:29

如果您在 Linux 上运行,您可能会被 IPTABLE 阻止。尝试禁用它并查看是否可以从远程 IP/主机名进行连接。

不管怎样,这看起来像是防火墙问题或 IP 地址不正确。
使用 ifconfig(基于 unix)或 ipconfig(win)查找您的 IP 地址

If you are running on Linux you might be blocked by IPTABLE. Try to disable that and see if you can connect from your remote IP/Hostname.

Either way it seems like a firewall issues or incorrect IP address.
Look up your IP Address with ifconfig (unix based) or ipconfig (win)

∞觅青森が 2024-09-10 06:45:29

如果这是一个家庭网络,我知道某些路由器/调制解调器不喜欢环回自身(我在 linksys 设备上看到过这种行为)。但 localhost 仍然可以工作,因为操作系统在它发送到网络设备之前捕获了它。您是否尝试过连接到计算机上的任何其他端口,或者只是对 IP 地址执行 ping 操作以查看其是否响应?

If this is a home network, I know that some routers/modems don't like looping back to themselves (I have seen this behavior with linksys devices). But localhost still works, because the OS catches it before it goes out to the network appliance. Have you tried connecting to any other ports on your machine, or just doing a ping of the IP address to see if it responds?

書生途 2024-09-10 06:45:29

谢谢大家,

通过重新安装我的 glassfish 服务器解决了这个问题。

Thank you all,

Resolved the issue by reinstalling my glassfish server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文