tags:

views:

106

answers:

4

I have created a web reference (Add Web Reference) from Visual Studio 2008 and strangely, I need to set the propertyNameFieldSpecified to true for all the fields I want to submit. Failure to do that and values are not passed back to the WCF Service.

I have read at several places that this was fixed in the RTM version of Visual Studio. Why does it still occurring?

My data contracts are all valid with nothing else than properties and lists. Any ideas?

A: 

I saw this happen in VB.NET with nullable values, C# however had the 'correct' code.

Maybe an idea will be to reference the service from a C# project. Then reference that project from your VB.NET code.

leppie
A: 

I'm using C#. I suspected that it has something to do with automatic properties but no luck.

Here is a sample class that :

[DataContract]
public class BrowserBase : IBrowser
{

    [DataMember]
    public BrowserType BrowserType { get; set; }

    [DataMember]
    public IList<ResolutionBase> Resolutions { get; set; }

}
Sebastien Lachance
I am using similar code, but I am on SP1 already, and cant recall now if the service was created before I applied SP1.Perhaps, you want to try VS2008SP1.
leppie
I'm using SP1 also. Sorry :(
Sebastien Lachance
A: 

The XSD.EXE tool is to blame. When you do "Add Web Reference" Visual Studio will generate classes for all the referenced types. To do this it uses the xsd.exe tool. There are replacements for xsd.exe out on the net

ie: http://www.bware.biz/DotNet/Development/CodeXS/Article/Article_web.htm

but I haven't see how to replace the behavior of Add Web Reference.

tecmo