Link to home
Start Free TrialLog in
Avatar of ptreves
ptreves

asked on

WebService Client not running

Hello all,

I ran a server portion on Glassfish for Eclipse Bundle and deployed that well on the Glassfish server v.3. I also used ant to build.xml.

However, when I try to run a client program, I get the following error:

javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8084/StockQuoteService/StockQuoteService?wsdl. It failed with:
      Connection refused: connect.
      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:151)
      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:133)
      at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254)
      at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217)
      at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165)
      at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)
      at javax.xml.ws.Service.<init>(Service.java:56)
      at sample.StockQuoteService.<init>(StockQuoteService.java:46)
      at sample.StockQuoteClient.main(StockQuoteClient.java:9)
Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:525)
      at java.net.Socket.connect(Socket.java:475)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
      at sun.net.www.http.HttpClient.New(HttpClient.java:306)
      at sun.net.www.http.HttpClient.New(HttpClient.java:323)
      at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
      at java.net.URL.openStream(URL.java:1010)
      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:793)
      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:251)
      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:118)
      ... 7 more

Any suggestions is appreciated...

Paolo
Avatar of ptreves
ptreves

ASKER

Hello,

When I use Ant to build.xml this is the output I get:

Buildfile: C:\workspace\Glassfish\StockQuoteServiceClient\build.xml
wsimport:
     [exec] parsing WSDL...
     [exec] Connection refused: connect
     [exec] Failed to read the WSDL document: http://localhost:8084/StockQuoteService/StockQuoteService?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
     [exec] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
     [exec]  At least one WSDL with at least one service definition needs to be provided.
     [exec]       Failed to parse the WSDL.
     [exec] Result: 1
BUILD SUCCESSFUL
Total time: 2 seconds

Any help is appreciated ...

Paolo
Avatar of ptreves

ASKER

I have read that I should run the wsgen utility on the server and the wsimport utility on the client. Could this be the cause of errors ?
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial