File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes DataHandler error in WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "DataHandler error in WSDL" Watch "DataHandler error in WSDL" New topic

DataHandler error in WSDL

jani sk

Joined: Jul 23, 2010
Posts: 4
hi i am new to java webservices,

i started learning it by using apache axis 1.4.

i was able to do a calcualtor example .

next i want to work with the attachements.

so i started it by writing an interface . its as fallows

i am using eclipse as editor.
i compiled it and then run the java2wsdl command to generate the WSDL.

WSDL was generated succesfully but its giving fallowing error in ECLIPSE

"The part 'dh' has an invalid value 'DataHandler' defined for its type. Type declarations must refer to valid values defined in a schema."

here i am giving the wsdl generated

can some one please help me how to get rid of this error??

Edited by Ivan: Please use code tags - it makes code and XML much more readable!
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 547


i'm also trying to learn Webservices and started with JWSDP and with JAX-RPC model. I have not done any coding for webservices so far, but trying to understand the concepts before jumpin..... I wanted to check, if you have any URL where I can get step by step approaches for JWSDP and Axis.

Since you are using axis now, can you tell me what links are you referring to for some code samples ?

My only issue is following the steps needed for generating artifacts both client and server side and for learning process, I do not want to use any intelligent IDE's and want to hard code as much as I can.


jani sk

Joined: Jul 23, 2010
Posts: 4
hi kumar,

you can find lot of online tutorials and sample examples to start with web services.
even i too did the same thing.

but i found the fallowing link is the best link and simple.

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183

I passed the WSDL document via the W3C Markup Validation Service and it looks fine.

It says -
This document was successfully checked as well-formed XML!


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
jani sk

Joined: Jul 23, 2010
Posts: 4
Thanks don for validating xml reply back,

but eclipse is showing error at the lines where datahandler is there in the wsdl file that is generated.

and the error says like datahandler datatype is not there in schema.

after googling i have placed activation.jar and mail.jar in the classpath. but still the issue persists...
Narender Reddy Soma

Joined: Jun 05, 2010
Posts: 23
Check classpath
jani sk

Joined: Jul 23, 2010
Posts: 4
class path is fine narender ..i found all jars of axis are in classpath including activation.jar and mail.jar.
subject: DataHandler error in WSDL
It's not a secret anymore!