This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

XML Any Element mapping to Java  RSS feed

 
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?).


 
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!
 
Our first order of business must be this tiny ad:
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!