• 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

xsi:nil="true" in soap request

 
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am working on consuming a webserice and everything seems to work fine except that sometimes one of the element in the Soap request has a value of xsi:nil="true" instead of the actual value. I was wondering what this xsi:nil="true" means and why I am getting this only during certain times and not all the time.

Thanks.
 
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!
It means that sometimes, some client of the web service does not enclose a parameter, but instead a null value. This is translated to xsi:nil="true" in an XML document.
Best wishes!
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Krizsan wrote:Hi!
It means that sometimes, some client of the web service does not enclose a parameter, but instead a null value. This is translated to xsi:nil="true" in an XML document.
Best wishes!



So that is something wrong with my code or the WSDL? How can I get rid of it?

Thanks.
 
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!
I would guess that there is something wrong in a client of your webservice, provided of course that you want to allow null values passed to your service.
It is hard to tell exactly how to find the problem, but, in the case you do not want to allow null parameter values, here is a suggestion:
Add a handler on the client side that examines the outgoing messages and especially the element which value sometimes is nil.
When the handler encounters a nil value in that element, it logs as much information as necessary to help you trace the problem to a log.
Best wishes!
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Krizsan wrote:Hi!
I would guess that there is something wrong in a client of your webservice, provided of course that you want to allow null values passed to your service.
It is hard to tell exactly how to find the problem, but, in the case you do not want to allow null parameter values, here is a suggestion:
Add a handler on the client side that examines the outgoing messages and especially the element which value sometimes is nil.
When the handler encounters a nil value in that element, it logs as much information as necessary to help you trace the problem to a log.
Best wishes!



Hi Ivan,

I really appreciate your replying back. Ok, so I checked my code and looks like I am populating only some of the fields of an object. I have corrected it and I am populating all the fields now. Now, this is where it gets interesting, sometimes, the SOAP request being sent (By Clicking a button) has all the fields filled with data like say for example,


But sometimes, it is just sending



Missing the firstName, middleName, lastName, and dateOfBirth. which should not be happening. Any idea as what might be causing this? The code I am using every time to send the SOAP request is same.

Thanks.


 
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!
That indeed looks very strange!
How to you create the payload of the SOAP request? JAXB?
I cannot tell why the SOAP request sometimes lacks certain data without having seen the code that creates the payload.
Best wishes!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic