File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes can i define my own xsd in WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "can i define my own xsd in WSDL" Watch "can i define my own xsd in WSDL" New topic
Author

can i define my own xsd in WSDL

maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
i have done axis webservice;one requirement is i generated WSDL using Java2WSDL command.can i my define own xsd in WSDL??if yes how?

[ September 15, 2006: Message edited by: maha laxmi ]
[ September 15, 2006: Message edited by: maha laxmi ]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
The xsd of wsdl had already been defined by w3c.Even if you write your own xsd for wsdl that has to be the same with that of the xsd defined by w3c (if you follow the same version of wsdl spec.)


Rahul Bhattacharjee
LinkedIn - Blog
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Yes, you can use your own XSD inside a WSDL (WSDL file imports). However you only do that when you are using WSDL2Java.

Specifying your own XSD inside a WSDL that is generated by Java2WSDL goes counter to the motivation behind Java2WSDL as a tool (i.e. removing "the burden" of knowing and understanding WSDL from the developer) - so I doubt that you can do that.
[ September 15, 2006: Message edited by: Peer Reynders ]
maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
Originally posted by Peer Reynders:
Yes, you can use your own XSD inside a WSDL (WSDL file imports). However you only do that when you are using WSDL2Java.

Specifying your own XSD inside a WSDL that is generated by Java2WSDL goes counter to the motivation behind Java2WSDL as a tool (i.e. removing "the burden" of knowing and understanding WSDL from the developer) - so I doubt that you can do that.

[ September 15, 2006: Message edited by: Peer Reynders ]



you mean while generating client stubs(WSDL2Java) only we can use our own xsd not while creating WSDL (Java2WSDL)
maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
"However you only do that when you are using WSDL2Java."


anyway we want to use our own xsd while using WSDL2Java only;;;
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
If he is asking about creating a xsd for WSDL..then how is this going to help..there is no need for that..is there is any need for creating a new xsd each time you make a new service.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by maha laxmi:
you mean while generating client stubs(WSDL2Java) only we can use our own xsd not while creating WSDL (Java2WSDL)

Correct. You can include your own XML Schema definitions in a WSDL that you have written yourself by using the mechanisms described in the article that I provided a link to in the earlier post.

Web services Programming Tips and Tricks: WSDL file imports
http://www-128.ibm.com/developerworks/xml/library/ws-tip-imports.html

Then you can use WSDL2Java to generate the client and server stubs.

Originally posted by Rahul Bhattacharjee:
If he is asking about creating a xsd for WSDL..then how is this going to help..there is no need for that..is there is any need for creating a new xsd each time you make a new service.


It is my understanding that maha laxmi wants to use some pre-defined XML data type definitions from an existing XML Schema file for the web service operation parameters, not redefine the schema for WSDL.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i define my own xsd in WSDL