users@jaxb.java.net

ConnectException when invoking a web service, can access wsdl via browser!

From: bfrederick <brent.frederick_at_higtek.com>
Date: Thu, 14 May 2009 10:24:27 -0700 (PDT)

Hi,

I am getting the following result whenever I invoke a remote webservice:

HTTP transport error: java.net.ConnectException: Connection refused: connect

Here is the code:

URL url = new URL("http://" + ip +
"/HGTRemoteInterCom/HGTInboxWSService?WSDL"); // NOI18N
QName qname = new QName("http://inboxWS/", "HGTInboxWSService"); // NOI18N
Service xservice = HGTInboxWSService.create(url, qname);
qname = new QName("http://inboxWS/", "HGTInboxWSPort"); // NOI18N
inboxWS.HGTInboxWS port = xservice.getPort(qname, inboxWS.HGTInboxWS.class);

Map<String, Object> ctxt = ((BindingProvider) port).getRequestContext();
ctxt.put(JAXWSProperties.CONNECT_TIMEOUT,
appinfoFacade.getConnectionTimeout());
ctxt.put(BindingProviderProperties.REQUEST_TIMEOUT, 2400000);
//appinfoFacade.getRequestTimeout());
ctxt.put(BindingProviderProperties.CONNECT_TIMEOUT,
appinfoFacade.getConnectionTimeout());
ctxt.put("com.sun.xml.ws.request.timeout", 2400000); //
appinfoFacade.getRequestTimeout());
ctxt.put("com.sun.xml.ws.connect.timeout",
appinfoFacade.getConnectionTimeout());

boolean result = port.fileInbox(wsCom);


The weird part is, I can access the WSDL and the tester via a browser on the
machine trying to invoke the webservice! We are running Glassfish v2...

http://ip/HGTRemoteInterCom/HGTInboxWSService?WSDL
and
http://ip/HGTRemoteInterCom/HGTInboxWSService?Tester

Work fine!
I am totally stumped... any ideas?

Thanks!!
-- 
View this message in context: http://www.nabble.com/ConnectException-when-invoking-a-web-service%2C-can-access-wsdl-via-browser%21-tp23545162p23545162.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.