aspose file tools
The moose likes Web Services and the fly likes Mandatory fields in WSDL2Java classes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Mandatory fields in WSDL2Java classes" Watch "Mandatory fields in WSDL2Java classes" New topic
Author

Mandatory fields in WSDL2Java classes

Muthukrishnan Manoharan
Ranch Hand

Joined: Aug 27, 2008
Posts: 90

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.
Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
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!


My free books and tutorials: http://www.slideshare.net/krizsan
Muthukrishnan Manoharan
Ranch Hand

Joined: Aug 27, 2008
Posts: 90

Thanks Ivan.

Any other alternatives than changing the WSDL? Because we dont have an independence to change the WSDL.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Mandatory fields in WSDL2Java classes
 
Similar Threads
timezone information from zipcode
Webservice Mapping
Adding attachments to web service response
File Attachment with WSDL2Java objects
How to get SOAP request XML for a web service call