Geeks With Blogs
Patrice Calve Life's short, have fun


You have a Web Service and a test client.  They (server + client) have been working great for months and all over sudden you're getting weird values.  The values sent from the server seem good, but the Xml/SOAP received doesn't get de-serialized correctly, and everything (or some properties) is set to default values (int=0, guid={00000000-0000-0000-0000-000000000000}, ...).  Read on !

The test client has a web reference to your Web Service.  A few web methods are returning objects (simple objects like Country(Id, NameEn, NameFr, etc.)).

When you run the Web Service from IE, the result is as expected:

  <?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfCountry xmlns:xsi="" xmlns:xsd="" xmlns="">
- <Country>
  <Provinces />

But for a reason or another, when you run it from your Test Client, every darn CountryId is set to 0.  If the the Id is a Guid, every row has a MyId = {00000000-0000-0000-0000-000000000000}.

Try updating your Web Reference(s)!  Right click the Web References -> Update Web Reference. 

Restart your test client.

How many times have I fallen in this trap? 

I hope this post will make me remember this mental note, and enlighten you!

Have fun, life's short


Posted on Wednesday, May 28, 2008 1:32 PM | Back to top

Comments on this post: Problem with .Net Web Services having values set incorrectly?

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Patrice Calvé | Powered by: