我在wcf web服务上创建并尝试使用SOAP UI进行测试。当使用soap ui进行测试时,例如创建员工,如果我使用
发送soap请求xml<empId>0</empId> works fine.
<empId></empId> **throwing exception.**
if i completly remove <empId> tag it works fine....
有没有办法在WCF中的wsdl中将默认值设为“0”?
NRK
答案 0 :(得分:1)
谷歌搜索后,我能找到这样的解决方案。 在类中,您需要指定属性,如下所示
[System.ComponentModel.DefaultValue(0)]
public int EmpId
{
get;set;
}
以下链接帮助我找到解决方案:
http://weblogs.asp.net/pgreborio/archive/2004/01/16/59360.aspx
NRK