[jboss-user] [JBoss Web Services] - My WebService Client always gets "Connection refused" Exception

Matthias M. do-not-reply at jboss.com
Wed Sep 5 06:10:51 EDT 2012


Matthias M. [https://community.jboss.org/people/virtuellesnugat] created the discussion

"My WebService Client always gets "Connection refused" Exception"

To view the discussion, visit: https://community.jboss.org/message/758006#758006

--------------------------------------------------------------
Hello everybody,

I'm facing the "Connection refused" execption when I try to use my JAX-WS based webservice on my JBoss AS 7.1.1. 
The Service itself seem to work properly, because the wsdl is generated and accessible via Browser and SoapUI. 
In SoapUI I've added my services and they work fine.

The server-side is implemented this way: 
{code} 
@Stateless 
@WebService ( 
    portName = "AppointmentFacadePort", 
    targetNamespace = " http://facade.appointment.wsServe.mmoell.de/ http://facade.appointment.wsServe.mmoell.de/") 
@SOAPBinding (style = Style.DOCUMENT, use = Use.LITERAL) 
public class AppointmentFacade { 
{/code}

I guess everything else is set anyway. But I'm not quite sure how to handle the "wsdlLocation" attribute of the @WebService Annotation.

I've tried many ways to implement the ws-client, but everytime I get the connection refused Exception. So I've checked the following:

*     the firewall doesn't block my requests (Browser, SoapUI, and remote calls via JNDI lookup succeed)
*     I'm not using a proxy
*     I'm using a host entry "master.de" which points to the correct address (everything else still works, and using the real ip doesn't help)

So let's take a look at the client-side implementations I've tried:

- using the generated classes by consuming the wsdl (I've used jboss' wsconsume tool and jdk's wsimport tool):

{code} 
AppointmentFacadeService serv = new AppointmentFacadeService(); 
AppointmentFacade port = serv.getPort(AppointmentFacade.class); 
System.out.println(port.getDateByString("05.09.2012 12:55")); 
{/code}

- another approach: 
{code} 
QName serviceName = new QName(" http://facade.appointment.wsServe.mmoell.de/ http://facade.appointment.wsServe.mmoell.de/", "AppointmentFacadeService"); 
String serviceURL = " http://master.de:8080/wsServe/AppointmentFacade http://master.de:8080/wsServe/AppointmentFacade"; 
URL wsdlURL = new URL(serviceURL  + "?wsdl"); 
Service service = Service.create(wsdlURL, serviceName); 
AppointmentFacade proxy = (AppointmentFacade)service.getPort(AppointmentFacade.class); 
System.out.println(proxy.getDateByString("05.09.2012 12:55")); 
{/code}

I tried a few more variations (for example the eclipse ws-client wizard), but the connection was still refused everytime. 
Exception Stack Trace I get, no matter which client-approach I use: 
{code} 
Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect

    at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(Unknown Source)

    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)

    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)

    at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)

    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)

    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)

    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)

    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)

    at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)

    at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)

    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)

    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)

    at $Proxy29.getDateByString(Unknown Source)

    at de.mmoell.wsServe.client.Main.main(Main.java:25)

Caused by: java.net.ConnectException: Connection refused: connect

    at java.net.DualStackPlainSocketImpl.connect0(Native Method)

    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)

    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

    at java.net.PlainSocketImpl.connect(Unknown Source)

    at java.net.SocksSocketImpl.connect(Unknown Source)

    at java.net.Socket.connect(Unknown Source)

    at java.net.Socket.connect(Unknown Source)

    at sun.net.NetworkClient.doConnect(Unknown Source)

    at sun.net.www.http.HttpClient.openServer(Unknown Source)

    at sun.net.www.http.HttpClient.openServer(Unknown Source)

    at sun.net.www.http.HttpClient.<init>(Unknown Source)

    at sun.net.www.http.HttpClient.New(Unknown Source)

    at sun.net.www.http.HttpClient.New(Unknown Source)

    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)

    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)

    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)

    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)

    ... 15 more
 {/code}

Has anyone an idea how to solve this problem? I'm trying to solve it for weeks now, but I won't succeed. 
Any help would be greatly appreciated!

Best regards, Matthias
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/758006#758006]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120905/6f6a2a21/attachment.html 


More information about the jboss-user mailing list