• 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

Mandatory fields in WSDL2Java classes

 
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a WSDL, with which I created Java Classes through WSDL2Java tool. But the problem is not all attributes that are returned from the response SOAP XML will have a value. Some may be null also. So when I construct back the objects from the response, it is not able to parse double object or Integer object as the nulls encounter NumberFormatException. Is there anyway I can specify to by pass null objects during Java Classes creation through the tool or do we have other good way to handle this.
 
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!
If you have the opportunity to be able to edit the WSDL, then use minOccurs="0" for elements that are optional.
There is also a nillable attribute for elements that can be set to true to allow for null values: nillable="true"
Best wishes!
 
Muthukrishnan Manoharan
Ranch Hand
Posts: 91
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ivan.

Any other alternatives than changing the WSDL? Because we dont have an independence to change the WSDL.
reply
    Bookmark Topic Watch Topic
  • New Topic