• Post Reply Bookmark Topic Watch Topic
  • New Topic

wsdl2java generation. skiping intermediate classes

 
Jina Lu
Greenhorn
Posts: 26
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm generating java code from wsdl using wsdl2java. As a result in some cases I have unnecessary intermediate classes. For example. Class A has variable of class B which has a list of class C.
Is it possible to skip class B without changing wsdl?
Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to achieve by this? In other words, why does it matter whether there are maybe a few unneeded classes?
 
Jina Lu
Greenhorn
Posts: 26
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This classes add additional complexity to my code that's why I'm trying to find out if it is possible to avoid it.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classes that get created reflect the data model in the WSDL, so if the Java code has unnecessary data objects, that means the WSDL has unnecessary data structures. So you need to remove those objects from the underlying WS service classes - then they'll be removed from the WSDL as well.
 
Jina Lu
Greenhorn
Posts: 26
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately I can't modify wsdl. If I understand you correctly I should live with those intermediate classes.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can modify the code after it's been created, but you would need to re-do those modifications each time you re-create the code from the WSDL - which may or may not be an issue.
 
Jina Lu
Greenhorn
Posts: 26
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changing generated code is not a good practice. Decided to use helper class to make code clearer. Thanks a lot. If someone knows other options let me know
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!