• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Axis generates unwanted xsi:nil elements

 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We're using axis to generate Java stubs from our WSDL, but when we generate a message and send it, it includes elements without values as <blahblah xsi:nil="true" /> which causes the server side to reject the request. The other strange issue is that these nil elements are even included in the request when it is a choice, that is all of the choice elements are returned, with the extra elements having xsi:nil

I have tries specifying <xsd:element ... nillable="false"> for some of the elements in the xsd description, but so far this has not had any effect.

We're running Axis 1.3, I've tried targetting 1.0 when generating the stubs (-T 1.0 running WSDL2Java) but had no effect either.
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is the choice element, by your design, empty?

For the element with 'xsi:nil="true"' to be valid, I think you should put <xsd:element ... nillable="true">. Default is 'nillable="false"'.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We don't specify a 'nillable' attribute in the element, but we still get the xsi:nil in the message I found a thread stating that trying -W for the WSDL2Java command line has fixed this in the past, but not for us.

I should also mention that we control the server and the incorrect management of the 'nil' attribute is caused by the Castor deserialisation, but at this stage it will not be a simple operation to upgrade Castor or replace it with something more robust. The Castor deserialisation has been there a while and has some custom code added to it, although luckily it is cleanly layered should we need to cut it lose later.
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic