• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JAX-WS Web Service Clients- Static Clients Problem

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
prashant k. gupta
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



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,
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
prashant k. gupta
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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…
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic