Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I define more than 2 XMLRootElement  RSS feed

 
Tim Lim
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to web service. I am using JAX-WS and I am encountering problems regarding the cyclic references.

I have read the way to avoid this cyclic references problem is to define XMLRootElement and XML Transient using this link.

I am thinking if it is possible to define 2 XMLRootElement in this scenario.

Department has a one to many relationship bidirectional to Employee
I define XMLRootElement in Department and XML Transisent in Employee.

However, if I want to get the Employee.Department, then I was thinking if I can do this
Defining XMLRootElement in Employee and XMLTransient in Department.

In another words, the reason why I would need to define 2 XMLRootElement is because I want to use the get method using different class (i.e if I want to get department, I would call getDept(), if I want to use get employee, I would use getEmployee().)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!