This happens for types with a default value other than zero. In these cases, the web service cannot know whether the parameter was set to the default value or simply not set at all.
You can get rid of the additional specification parameter by decorating your operation with the [XmlSerializerFormat] attribute, for example:
[OperationContract] [XmlSerializerFormat] string GetEmpInfo(int? empNo);
This attribute can also be added at the class level, and this will make sense in most cases.
I understand that you can handle this situation using types with a null value ( int? ), But I could not fix it using this.
source share