aspose file tools*
The moose likes Web Services and the fly likes NetBeans Web Service client attempt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "NetBeans Web Service client attempt" Watch "NetBeans Web Service client attempt" New topic
Author

NetBeans Web Service client attempt

Ed Carrington
Ranch Hand

Joined: Oct 11, 2007
Posts: 77
I have NetBeans 6.7 on Tomcat 6.0.20.
I have built regular Web apps with NetBeans and Tomcat 6.0.20, but now I want to build my first Web Service client using the demo that comes with NetBeans called StockQuoteClient.

After I hit the Run command I get the following failed message:



Do I need to load something to make this work?
Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
Maybe make sure you have JAX-WS 2.1 added as a library. Get into your project properties and click Add Library, you should see the jax-ws2.1 library there. Hope that helps.
Ed Carrington
Ranch Hand

Joined: Oct 11, 2007
Posts: 77
I added the JAX-WS 2.1 libary and attempted Run again and got the following message:


Please advise.
Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
Ed Carrington wrote:I added the JAX-WS 2.1 libary and attempted Run again and got the following message:
[code]
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
wsimport-init:
Created dir: C:\webnet\StockQuoteClient\StockQuoteClient\build\generated-sources\jax-ws
wsimport-client-StockService:
Created dir: C:\webnet\StockQuoteClient\StockQuoteClient\build\generated\jax-wsCache\StockService
Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
parsing WSDL...


[ERROR] Unable to parse "http://localhost:8080/StockQuoteService/StockService?xsd=1" : Connection refused: connect
line 47 of file:/C:/webnet/StockQuoteClient/StockQuoteClient/src/conf/xml-resources/web-service-references/StockService/wsdl/localhost_8080/StockQuoteService/StockService.wsdl

[ERROR] Unable to parse "http://localhost:8080/StockQuoteService/StockService?xsd=1" : Connection refused: connect

Failed to read the WSDL document: file:/C:/webnet/StockQuoteClient/StockQuoteClient/src/conf/xml-resources/web-service-references/StockService/wsdl/localhost_8080/StockQuoteService/StockService.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>.


[ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):


Please advise.


Are you running this locally (laptop or desktop)? If you deployed this to another box then it's likely the environment changed. That could mean that your service is looking for the wsdl on the c drive and if you deployed to Linux then there is no c drive. In which case you need to put the wsdl in a place where your deployed code can retrieve it.

I could be way off too.

I had a similar problem and solved it by putting the wsdl on a different box I could connect to. In my case, the wsdl came from a COBOL web service that didn't have a mechanism for publishing the wsdl. So I had initially put it on my c drive and ran into problems when I deployed to a Linux box. My solution was to put the COBOL wsdl on another box and then reference the wsdl from there. I also had some proxy issues that, thankfully, my server support team helped me hurdle. I should also mention that the app I was working on was a daisy chained web service. That is to say that a front end client connected to my web service that connected to a Legacy (COBOL) web service.

If you are using an example, it doesn't seem like it should be this difficult. Wish I could be of more help and give you a better concrete answer.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Have you installed Metro in Tomcat, as described on this webpage: https://metro.dev.java.net/2.0/ ?
Basically, what it does is copy some JARs into the Tomcat installation.
After having installed Metro, developing web services in NetBeans and deploying to Tomcat is identical to when deploying to GlassFish.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NetBeans Web Service client attempt