未生成属性的svcutil命名空间

时间:2014-06-29 17:15:28

标签: c# wsdl

我使用svcutil使用wsdl生成以下代码。但是名称空间'在属性级别未设置XmlElementAttribute。我在这里缺少一些设置吗?

' NameSpace'在属性XmlTypeAttribute的类级别生成正常。

我之前使用' NameSpace'生成了相同wsdl的代码。在物业级别设定的价值。只是想知道如果我错过了一个设置。我已经检查了msdn中的文档,但找不到任何可以设置为使其工作的标志。

有任何解决此问题的建议吗?

[System.Xml.Serialization.XmlTypeAttribute(TypeName = "custom-message", Namespace =     "http://tat.com/bba/mprovider")]
    public partial class custommessage
    {   
        private information informationField;
        private int typeField;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("ivr-information", Order = 0)]
        public information information
        {
            get;            
            set;
        }
}

1 个答案:

答案 0 :(得分:0)

继承XML命名空间。这意味着如果custom-message和ivr-information都具有相同的命名空间,则只在父元素上生成,子节点继承此命名空间。