Connection refused
ernie666 Dec 5, 2004 1:47 PMHi!
I hope someone can help me solving a problem at calling a webservice from other hosts than the one, JBoss is running on.
I read the Getting started manual and created a (very simple) session bean which i want to deploy as a webservice. The session bean contains only a single method hello() which shall write "hello" to the output if it is
called.
Everything is working fine, the deployment is done and the service works
but only for calls from the same computer JBoss is running on.
When I try to call it from my notebook or any other computer, i get
the following exception:
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.hello(Unknown Source)
at WSClient.main(WSClient.java:40)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:135)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:162)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:118)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:162)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:125)
at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:126)
at org.apache.axis.client.Call.invokeEngine(Call.java:3039)
at org.apache.axis.client.Call.invoke(Call.java:3024)
at org.apache.axis.client.Call.invoke(Call.java:2619)
at org.apache.axis.client.Call.invoke(Call.java:2524)
at org.apache.axis.client.Call.invokeInternal(Call.java:1976)
at org.apache.axis.client.Call.invoke(Call.java:1917)
at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:175)
at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:251)
... 2 more
The client code:
public class WSClient { public static void main(String[] args) throws Exception { URL url = new URL("http://localhost:8080/SIApplicationServerEJB/WSBean?wsdl"); QName qname = new QName("http://facades.ejb.applicationServer", "WSBean"); ServiceFactory factory = ServiceFactory.newInstance(); Service service = factory.createService(url, qname); WSEndpoint endpoint = (WSEndpoint)service.getPort(WSEndpoint.class); endpoint.hello(); } }
The exception is thrown at "endpoint.hello();" line.
Thx. Ernie