• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

array types

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is something like the below valid? It looks correct but how does one go about initializing the objects?



It easily done in php by using something like: How would one do it in Java? thanks in advance.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Yes, it does look valid to me.
Have you tried to compile the XML schema that contains your type usign XJC, the JAXB XML schema compiler plugin?
It will help you generate Java classes that you can use to create object hierarchies in memory that you later serialize to XML.
If you are working in Eclipse, there is even a XJC plugin that let you do the schema compilation from within the IDE.
Best wishes!
 
john s murray
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thks for the reply. Yes, it does compile. I was able to wsdl2java it and it only creates the classes for the "MyArrayObjects". Meaning I was able to doing something like: This would only create something like:


The above will not work as it's expecting:


How would I do it so that it creates the above?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
From what web service stack is the wsdl2java command?
Try using the xjc command that should be included in any recent JDK.
To determine if you have the command or not, try the following in a terminal window:

I get the following output:

I suspect this is not the latest version of JAXB, but it should be recent enough.
Best wishes!
 
john s murray
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I was able to deploy and generate the wsdl. however, when I use the wsdl2java tool to generate the java class files, it doesn't seem to be generating the MyArrayObjects classes. I would expect it generate class files for MyArray1Type objects and MyArrayObjects. Or a way for me to do something like:


Do I need to change it to something like?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic