propertyNameFieldSpecified when generating a 2.0 web service proxy from a WCF Service

StackOverflow https://stackoverflow.com/questions/133430

  •  02-07-2019
  •  | 
  •  

Question

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?

OTHER TIPS

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.

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; }

}

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top