• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML Any Element mapping to Java  RSS feed

 
Uthman Bashir
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just started learning about web services and am struggling with the generated java code from a wsdl file.

The part of the wsdl is


Using wsimport I get my generated java code. I don't understand how to use the set_Any() and get_Any() methods.




A sample xml EToNRequest is


Can someone please explain and give examples of how to use the set_Any() and get_Any() methods to set and get the value of the xml elements? Apologies if the subject title is misleading, I'm sure if this xml or java assertion issue (if either?).


 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Even though the xsd:any type is mapped to an Object, you have to insert a DOM Element instance or a JAXB object.
To have the xsd:any type mapped to DOM Element, you can use the processContents="skip" attribute on the <any> element.
Take a look at this page: https://jaxb.dev.java.net/guide/Mapping_of__xs_any___.html
Best wishes!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!