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
ptrevesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ptrevesAuthor Commented:
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
0
ptrevesAuthor Commented:
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 ?
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Try opening this URL in your browser http://localhost:8084/StockQuoteService/StockQuoteService?wsdl 

see if the WSDL shows up, have you deployed the service ?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Services

From novice to tech pro — start learning today.