wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes JAX-WS Web Service Clients- Static Clients Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "JAX-WS Web Service Clients- Static Clients Problem" Watch "JAX-WS Web Service Clients- Static Clients Problem" New topic
Author

JAX-WS Web Service Clients- Static Clients Problem

prashant k. gupta
Ranch Hand

Joined: May 15, 2008
Posts: 62
Hi All,

I was trying the example of Ivan’s study notes for SCDJWS (4.9 JAX-WS Web Service Clients). While trying static Clients after generating the artifacts in RAD7, I am getting below error:-

Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: file:./WEB-INF/wsdl/CalculatorService.wsdl. It failed with:
.\WEB-INF\wsdl\CalculatorService.wsdl (The system cannot find the path specified.).
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:148)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:134)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:227)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:190)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:160)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:92)
at javax.xml.ws.Service.<init>(Service.java:67)
at com.ivan.calculator.CalculatorService.<init>(CalculatorService.java:38)
at com.ivan.client.CalculatorClient.callService(CalculatorClient.java:25)
at com.ivan.client.CalculatorClient.main(CalculatorClient.java:15)
Caused by: java.io.FileNotFoundException: .\WEB-INF\wsdl\CalculatorService.wsdl (The system cannot find the path specified.)
at java.io.FileInputStream.<init>(FileInputStream.java:112)

Seems to be problems with the dependency injection and also when I try to create the service in the code then I am getting this error, could you please let me know if I need to change anything in code?

Thanks
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2258
    
    3

Well champ, it looks like the CalculatorService.wsdl is not being found:

Caused by: java.io.FileNotFoundException: .\WEB-INF\wsdl\CalculatorService.wsdl (The system cannot find the path specified.)

Are you sure the file is there, or that you are indicating the .wsdl file correctly?


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
prashant k. gupta
Ranch Hand

Joined: May 15, 2008
Posts: 62


Well champ, it looks like the CalculatorService.wsdl is not being found:



I checked already, CalculatorService.wsdl is in place and CalculatorService is deployed and running, i am able to get the response from Dynamic Client, as already posted in different post, but in Static Client I am stuck here. I couldn't think any other problem here, any thoughts?


Thanks,
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
How are you developing the static client example program in RAD?
Note if you use any RAD-specific features to develop the static client I regretfully cannot help you. The example is intended to be developed with Eclipse and the standard wsimport command that comes with Java SE 6.
In the example the location of the WSDL is specified to be http://localhost:8080/JAX-WS_Server_wsgen/CalculatorService?wsdl and there is no mentioning of it being stored to a file.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
prashant k. gupta
Ranch Hand

Joined: May 15, 2008
Posts: 62
I am using RAD7 features to generate the webservice clients from CalculatorService.wsdl, and then simply I created static client as per example, but while looking up the wsdl I am getting this error, I changed the wsdl location in static client as below:-

@WebServiceRef(wsdlLocation ="http://localhost:9080/WebServiceTestWeb/CalculatorService.wsdl")

Also in generated CalculatorService class, I can see that below path is used:-

@WebServiceRef(wsdlLocation ="http://localhost:9080/WebServiceTestWeb/CalculatorService")

And WebServiceTestWeb is already deployed on server and running, but then also I am getting the error posted before…still need to look more for this.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
Would you consider using the Ant-script that is enclosed in the example instead of RAD7-specific features?
At least to get the example running, after which you can try out other versions at your own leisure.
Following the example will also have the advantage of me being able to help you if you run into problems.
Best wishes!
prashant k. gupta
Ranch Hand

Joined: May 15, 2008
Posts: 62
Hi Ivan,

I looked some more and found that in CalculatorService.java, when I run static client then it’s trying to create URL as below:-



And it was not able to locate and throwing below error as earlier post:-

Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: file:./WEB-INF/wsdl/CalculatorService.wsdl. It failed with:

Then I changed code in CalculatorService.java as below:-




After that it started working and I was able to invoke Calculator WebService and getting proper response.

Same issue I found when I used JAVAEE clients by using JSP since there also Dependency Injection was not working so I had to create CalculatorService in code. So here is the quick summary how I was able to run different clients for this example:-

1- JAVAEE Client by using Servlet- Dependency Injection worked here and was able to invoke Calculator web service without any issue.

2- JAVAEE Client by using JSP and Static Client- Dependency Injection doesn’t work here for me and created CalculatorService in code as given example:-

CalculatorService mCalculatorService = new CalculatorService();

And the changed the url for WSDL Location as above, then it started working.

3- Dynamic Client – worked without any issue.


Thanks…
 
 
subject: JAX-WS Web Service Clients- Static Clients Problem
 
Similar Threads
Java client calling ssl web service on WAS7
NetBeans JAX-WS WSDL
javax.xml.ws.Service problem
WSDL access error
javax.xml.ws.Service problem