这种类型没有预料到。使用XmlInclude或SoapInclude属性指定静态未知的类型

时间:2017-11-28 09:15:33

标签: c# .net xml asp.net-mvc wcf

以下是我的代码段。以下请求我们发布到服务。我们编写了nServiceBus,创建了Channel,factiry calss并尝试调用wcf服务。我们的SubmitJobRequest低于编码。 当我打电话时,它给我们例外说: -

  

{"预计不会出现这种类型。使用XmlInclude或SoapInclude属性指定静态未知的类型。"}

 public class SubmitJobRequest : LoftwareRequest
        {
            public SubmitJobRequest()
            {
                JobRequestElement = new JobRequest();
            }

            [XmlElement(ElementName = "jobRequest")]
            public JobRequest JobRequestElement { get; set; }

            public class JobRequest
            {
                public JobRequest()
                {
                    JobData = new JobData();
                    Processes = new Processes();
                }

                [XmlElement(ElementName = "clientCode")]
                public string ClientCode { get; set; }

                [XmlElement(ElementName = "description")]
                public string Description { get; set; }

                [XmlElement(ElementName = "destination")]
                public string Destination { get; set; }

                [XmlElement(ElementName = "duplicates")]
                public string Duplicates { get; set; }

                [XmlElement(ElementName = "folderUrl")]
                public string FolderUrl { get; set; }

                [XmlElement(ElementName = "ignoreErrors")]
                public bool IgnoreErrors { get; set; }

                [XmlElement(ElementName = "jobData")]
                public JobData JobData { get; set; }

                [XmlElement(ElementName = "processes")]
                public Processes Processes { get; set; }
            }

0 个答案:

没有答案