Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

xsi:nil="true" in soap request  RSS feed

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • 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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!