Empty string coming from web services

N

NormD

I have a web service method that returns a dataset. A field in a datatable in
the dataset in the server has 120 chars long empty string as it's value. When
this comes back to client the field value is trimmed. Why is this happening?
Any help to get around this is greatly appreciated.
 
K

Kevin Yu [MSFT]

Hi,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
M

[MSFT]

Hello,

This is a known issue. A DataSet will be converted into XML string before
sending from web service. For a empty string in a dataset, it may be
converted as following ("name" is the field name):

<name> </name>

On client side, it will be recognize as a null string.

Normally, " " make same sense with "". If you really a empty string with
defined length, you may add a column in your dataset with base64Binary type
and convert the string into this column. On client side, you need to
convert it back to string.

Luke
 
N

NormD

Is there any other way of handling this? As it's, I can't change how the
program executes since it's pretty generic.
 
M

[MSFT]

The Empty string has been "compressed" on server side. If we cannot change
the server side's code, it will be impossible to get the actual value on
client side.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top