Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

representing null values in SOAP web services

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am currently in the process of creating a web service client. For all optional data elements if we don't have values available we don't pass that element in the SOAP request payload and things work fine but for some specific use cases which we cannot control these elements are being passed something like this



which causes the web service to fail. In general what is the correct way to handle this. should we not be passing the elements in the absence of values or should we pass empty elements
().
In the latter two I believe the value the Web service receives is blank ("") hence causes it to fail.

Should the web service be handling blank strings or not passing the element at all is the right way to represent null values.

Let me know your thoughts


Thanks,
 
Jim Akmer
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the type of the element encapsulated in the tag send to client?
Are you using RPC encoding?
 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes Jim. The web services we are trying to communicate with were created years back and they were generated using RPC based java web service standards.
These web services were created using the bottom-up approach.

My question is more generic is should i not pass the soap request elements at all if there are no values or should I resort to empty elements. What is the right way to deal with missing values in the SOAP based webservices world.


Thanks
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you set a null value via (SOAP) Web Services? might help.

Regards,
Dan
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Another link to an article: http://www.ibm.com/developerworks/xml/library/ws-tip-null.html
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic