添加服务引用生成我的客户端无能

时间:2013-04-17 11:48:23

标签: c# wcf

当我“添加服务参考”以定位我的wcf时,出现了问题。

我定位我的wcf并点击确定。你通常会得到一个很好的生成文件,如Reference.cs(客户端)。我知道Reference.cs是无法生成的。见下文:

namespace WindowsPhoneApp.ServiceReference1 {
    using System.Runtime.Serialization;


    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="AlgemeenKlassementJSON", Namespace="http://schemas.datacontract.org/2004/07/WcfOpzet.jsonModels")]
    public partial class AlgemeenKlassementJSON : object, System.ComponentModel.INotifyPropertyChanged {

        private long idField;

        private long puntenField;

        private string rennersField;

        private long rondesField;

        private long teamnrField;

        [System.Runtime.Serialization.DataMemberAttribute()]
        public long id {
            get {
                return this.idField;
            }
            set {
                if ((this.idField.Equals(value) != true)) {
                    this.idField = value;
                    this.RaisePropertyChanged("id");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public long punten {
            get {
                return this.puntenField;
            }
            set {
                if ((this.puntenField.Equals(value) != true)) {
                    this.puntenField = value;
                    this.RaisePropertyChanged("punten");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string renners {
            get {
                return this.rennersField;
            }
            set {
                if ((object.ReferenceEquals(this.rennersField, value) != true)) {
                    this.rennersField = value;
                    this.RaisePropertyChanged("renners");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public long rondes {
            get {
                return this.rondesField;
            }
            set {
                if ((this.rondesField.Equals(value) != true)) {
                    this.rondesField = value;
                    this.RaisePropertyChanged("rondes");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public long teamnr {
            get {
                return this.teamnrField;
            }
            set {
                if ((this.teamnrField.Equals(value) != true)) {
                    this.teamnrField = value;
                    this.RaisePropertyChanged("teamnr");
                }
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="TeamsJSON", Namespace="http://schemas.datacontract.org/2004/07/WcfOpzet.jsonModels")]
    public partial class TeamsJSON : object, System.ComponentModel.INotifyPropertyChanged {

        private WindowsPhoneApp.ServiceReference1.Image fotorennerAField;

        private byte[] fotorennerBField;

        private long idField;

        private byte[] landrennerAField;

        private byte[] landrennerBField;

        private string rennerAField;

        private string rennerBField;

        private string teamNaamField;

        private byte[] teamShirtField;

        [System.Runtime.Serialization.DataMemberAttribute()]
        public WindowsPhoneApp.ServiceReference1.Image fotorennerA {
            get {
                return this.fotorennerAField;
            }
            set {
                if ((object.ReferenceEquals(this.fotorennerAField, value) != true)) {
                    this.fotorennerAField = value;
                    this.RaisePropertyChanged("fotorennerA");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public byte[] fotorennerB {
            get {
                return this.fotorennerBField;
            }
            set {
                if ((object.ReferenceEquals(this.fotorennerBField, value) != true)) {
                    this.fotorennerBField = value;
                    this.RaisePropertyChanged("fotorennerB");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public long id {
            get {
                return this.idField;
            }
            set {
                if ((this.idField.Equals(value) != true)) {
                    this.idField = value;
                    this.RaisePropertyChanged("id");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public byte[] landrennerA {
            get {
                return this.landrennerAField;
            }
            set {
                if ((object.ReferenceEquals(this.landrennerAField, value) != true)) {
                    this.landrennerAField = value;
                    this.RaisePropertyChanged("landrennerA");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public byte[] landrennerB {
            get {
                return this.landrennerBField;
            }
            set {
                if ((object.ReferenceEquals(this.landrennerBField, value) != true)) {
                    this.landrennerBField = value;
                    this.RaisePropertyChanged("landrennerB");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string rennerA {
            get {
                return this.rennerAField;
            }
            set {
                if ((object.ReferenceEquals(this.rennerAField, value) != true)) {
                    this.rennerAField = value;
                    this.RaisePropertyChanged("rennerA");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string rennerB {
            get {
                return this.rennerBField;
            }
            set {
                if ((object.ReferenceEquals(this.rennerBField, value) != true)) {
                    this.rennerBField = value;
                    this.RaisePropertyChanged("rennerB");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public string teamNaam {
            get {
                return this.teamNaamField;
            }
            set {
                if ((object.ReferenceEquals(this.teamNaamField, value) != true)) {
                    this.teamNaamField = value;
                    this.RaisePropertyChanged("teamNaam");
                }
            }
        }

        [System.Runtime.Serialization.DataMemberAttribute()]
        public byte[] teamShirt {
            get {
                return this.teamShirtField;
            }
            set {
                if ((object.ReferenceEquals(this.teamShirtField, value) != true)) {
                    this.teamShirtField = value;
                    this.RaisePropertyChanged("teamShirt");
                }
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    public class Image {

**Incomplete!**
    }
**Incomplete! I miss my operations of my wcf**
}

这是我的问题开始的图像。 (需要至少10个rept点,没有图像:D)

1 个答案:

答案 0 :(得分:3)

请勿使用datacontractserializer无法处理的非可加密类型,例如System.drawing。