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.).
Caused by: java.io.FileNotFoundException: .\WEB-INF\wsdl\CalculatorService.wsdl (The system cannot find the path specified.)
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?
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?
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.
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:-
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.
Joined: Oct 04, 2006
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.
prashant k. gupta
Joined: May 15, 2008
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:-
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.