asp.net中web服务wsdl的默认值

问题描述:

我在wcf web服务上创建并尝试使用SOAP UI进行测试。当用肥皂UI测试,例如创建一个员工,如果我发送SOAP请求XML与asp.net中web服务wsdl的默认值

<empId>0</empId> works fine. 
<empId></empId> **throwing exception.** 
if i completly remove <empId> tag it works fine.... 

有没有什么办法,使默认值设为“0”,在WSDL的WCF?

NRK

谷歌上搜索更多后,我能够找到这样的解决方案。 在类的属性,你需要指定以下链接下方

[System.ComponentModel.DefaultValue(0)]  
public int EmpId 
{ 
get;set; 
} 

喜欢的属性帮我找到了解决方案:

http://weblogs.asp.net/pgreborio/archive/2004/01/16/59360.aspx


NRK