AnsweredAssumed Answered

Formatting error when accessing query web service

Question asked by ChrisHardie on Mar 31, 2012
Latest reply on Apr 13, 2012 by nick_darlington
Good morning,

I have created a function in C# that submits a request to a Clarity web service. Everything functions fine, except at times I get FormattingExceptions.

It turns out that under the covers, as the resultset is built, a call is made to StringToNumber() when an XML value needs to be transformed into a number. The issue I am having is that as objects are being constructed, there are times when certain fields are null. And when I say null, I mean "null" is written between the element tags.

So if I get a result back that includes something like:

<age>null</age>

"null" is passed to StringToNumber() which throws the exception. I'm unable to write any code to deal with this as the exception is thrown "under the covers" through the web service reference. Anyone deal with this before?

Thanks!

Chris

Outcomes