aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Why my schema not defining a complex class definition, during WSGEN ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Why my schema not defining a complex class definition, during WSGEN ?" Watch "Why my schema not defining a complex class definition, during WSGEN ?" New topic
Author

Why my schema not defining a complex class definition, during WSGEN ?

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Hello All,

I have a class defined as below



and I'm generating the wsdl using the wsgen, used in a build file.



The schema that is generated is as below



My customer class consists of several fields lke fName, lName, phone and Address object which is also defined. But I do not see neither Customer, Address and also CustomerException properly defined in schema. Why is this happening? Do I need to annotate and specify to have these classes also be included in schema definition. Please advice.


Regards
KumarRaja

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Could some one advise me this?
Bogumil Zebek
Greenhorn

Joined: Dec 23, 2010
Posts: 3
Could you show us your Customer class?

I had the same problem when I defined the class without getters and setters for class fields.
After code update xsd was generated correctly.

To generate wsdl file with xsd I used maven2 plugin jaxws-maven-plugin



Result:


Best regards
Bogumil
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I took what snippets you provided in your first post and added my own Customer and CustomerException etc and managed to create a WSDL file as well as a XML schema which has a customer complex type that looks like this:

My Customer class is a POJO without any annotations.

Some advice:
- Check the console output after having run your Ant script carefully - did the execution really succeed?
- Please post more complete files, not just excerpts, when asking.
- Where is the wsgen command that you use to generate the artifacts?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why my schema not defining a complex class definition, during WSGEN ?
 
Similar Threads
wscompile - how to generate wsdl from service endpoint
Axis2 POJO web service - wsdl generating xs:anyType
java.io.IOException:CreateProcess error=5, Access is denied(While running build.xml in Ant editor)
JAX WS
How to generate WSDL file for any JAX-WS?