I just had a laptop crash (spilled water on it). I copied my working code (2 days ago backup) from a Windows Server 2008 laptop to a Vista laptop running Visual Studio 2008 SP1. Both are running .NET 3.5 SP1.
I have a web method call which is returning product information.
Some of the fields in the web service (running on a hosted server) are as follows :
public class Product
{
[XmlAttribute("sku")]
public string SKU;
[XmlAttribute("name")]
public string Name;
[XmlAttribute("category")]
public string CategoryName;
[XmlAttribute("categoryKey")]
public string CategoryKey;
public List<ProductSectionInfo> Sections;
public List<MediaItem> MediaItems;
public string Foo = "bar";
}
public class MediaItem
{
[XmlAttribute("type")]
public string Type;
[XmlAttribute("imageKey")]
public string ImageKey;
[XmlAttribute("path")]
public string Path;
[XmlAttribute("thumbnailPath")]
public string ThumbnailPath;
[XmlAttribute("thumbnailImageKey")]
public string ThumbnailImageKey;
[XmlAttribute("selectable")]
public bool Selectable;
}
When I run a 'GetProduct'
web method the 'Sections'
property is being populated in my C# client (on the new laptop) but the 'MediaItems
' property is not. It just comes out as null in the watch window.
So I look in Fiddler and both are populated in the XML. Both are Lists, being defined in my proxy as standard [] arrays.
You may have noticed I added a 'Foo' property above. I did this on the server, recompiled and recreated the web-reference. I was able to verify that in the client the 'Foo' property did come across. So its not that 'MediaItems' is capitalized or anything like that.
I'm pretty convinced that there's something on this new laptop that is different from the other. I hadn't really written anything new, had made only changes elsewhere. And I didn't even recreate the service reference proxy until I noticed an issue. Another instance of my client running on a test server is running fine hitting the same service.
Fixed laptop is coming back tomorrow, but I'd really like to get to the bottom of this. I'm pretty puzzled. I've seen all kinds of weird things like this before but really cant see whats going on here. Can I debug into the proxy somehow?