有时无法访问Web服务

时间:2012-06-19 05:59:03

标签: java web-services

我一直在收到此异常from time to timewhile accessing the webservice provided by this site.

webservice: https://int.yumzing.com/index.php?func=sessionCreate

它有时会起作用,然后却不起作用。 我试过ping网站“int.yumzing.com”,这有效.... 但more frequently its inaccessible when i am trying to access the web service通过我的程序,传递用户名和密码。

If there was some problem with my program, then it wouldnt had been accessible even for once... but it works from time to time.

我目前对此深有体会,因为我无法理解这可能是问题的根源。

请参阅下面的例外What i know is that UnknownHostException will take place when there is a problem in the Intial Connection.

java.net.UnknownHostException: int.yumzing.com
at java.net.InetAddress.lookupHostByName(InetAddress.java:513)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)
at java.net.InetAddress.getAllByName(InetAddress.java:242)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
at com.yum.zing.APIHandling$1.run(APIHandling.java:415)
at java.lang.Thread.run(Thread.java:1096)

1 个答案:

答案 0 :(得分:1)

您的案例int.yumzing.com中的任何主机名都会映射到计算机上的某个位置。例如,当您拥有经常更改的动态IP时,这很有用,因为它允许客户端和服务器之间进行透明通信。否则,每次IP地址更改时都应该知道所有客户端。

当有人试图通过其域名访问服务器时,会启动级联DNS调用以查找目标计算机的IP并建立连接。对于某些与互联网相关的原因,大多数情况下可能是您自己,解决过程失败并且您得到上述错误。

有关DNS的更多信息,请查看http://en.wikipedia.org/wiki/Domain_Name_System