aspose file tools*
The moose likes Web Services and the fly likes WSDL to Java not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDL to Java not working" Watch "WSDL to Java not working" New topic
Author

WSDL to Java not working

Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
During the past six months or so I've tried several java2wsdl/wsdl2java tools (included with Axis, WebSphere, Wasp, etc.) while playing around and none of them worked properly. Usually some ClassDefNotFound type-of error. I did try to figure out which .jar was missing from the classpath but without success.
Well, yesterday I really "needed" the functionality (generating a Java client based on a WSDL document) because I was in the power-save mode after a long, long day... "Wow, my Eclipse's Lomboz J2EE plugin has a wizard for creating a Java client out of a WSDL!" Well, that didn't work either. It said something as helpful as "Failed to generate SOAP client. Check the error log" (btw. where is the error log?)...
Please, do tell me what tools are you guys out there using for this task and what env problems have you had (and solved, hopefully)?
a) wsdl -> java
b) java -> wsdl


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
hi
i have used the wsdl2java and java2wsdl of axis along with ibm's wsdl4j and was able to parse and create java types based on the wsdl types with reasonable ease.Can you tell the exact exception or error you got while using the same?


Help me!Help you!!!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I tried Axis some time ago but I can't remember the exact errors. I'll retry and get back to you. It'll take some time however because I have a thousand things to do on my way home and there's a must-see sports event on TV tonight
Thanks for your interest!
Ramesh Nagappan
Author
Ranch Hand

Joined: May 06, 2003
Posts: 159
Have you tried using Sun JWSDP Environment especially using JAX-RPC. It provides a "wscompile" utility which allows to generate JAX-RPC Stubs and Services.
- Here is the URL to WSCompile utility:
http://java.sun.com/webservices/docs/1.1/tutorial/doc/JAXRPC6.html
BTW, JAX-RPC is going to be part of J2EE 1.4 and it will be the defacto RPC based Web services environment in J2EE 1.4. If you want to know more about JAX-RPC, you may take a look at
http://java.sun.com/xml/jaxrpc/


Ramesh Nagappan CISSP<br />Co-Author of "Core Security Patterns"<br />nramesh@post.harvard.edu<br /><a href="http://www.coresecuritypatterns.com" target="_blank" rel="nofollow">www.coresecuritypatterns.com</a>
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Ye Gods!
Thanks for the tip -- wscompile actually worked right out of the box. However, I bumbed into the next problem when trying to compile a simple client for testing the generated stub:

In which .jar should the BasicService.class reside? I've got jaxrpc-ri.jar and jaxrpc-api.jar from the Sun JAXRPC reference implementation download but the jaxrpc-ri.jar doesn't contain that class (it does contain other classes from that same Java package).
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Ok. Solved it. I had a different version of jaxrpc-ri.jar in CLASSPATH... When I switched to the one shipped with JWSDP, the missing class was found.
However, the joy quickly stopped to another frustrating error message...

Line 53 of the generated stub helper is the only one in the following method:

Any insight on this?
Ramesh Nagappan
Author
Ranch Hand

Joined: May 06, 2003
Posts: 159
Originally posted by Lasse Koskela:
Ok. Solved it. I had a different version of jaxrpc-ri.jar in CLASSPATH... When I switched to the one shipped with JWSDP, the missing class was found.
However, the joy quickly stopped to another frustrating error message...

Line 53 of the generated stub helper is the only one in the following method:

Any insight on this?

Did you confirm, your mapping of each supported XML data type to Java data type as per JAX-RPC spec.
I have seen interoperability issues, When WSDL generated by some SOAP implementations has custom data types which is not as per WSDL 1.1/SOAP 1.1 specifications. You may take a look at the JAX-RPC spec or JAX-RPC tutorial to confirm it.
Another thing, Could you add more code details !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSDL to Java not working