2013-04-17 87 views
0

當我「添加服務引用」來定位我的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

如果您正確地將[OperationContract]放在缺少的方法(在界面中定義)上,您是否檢查過WCF端? – Fabske

+0

你不能通過Visual Studio「更新服務引用」嗎? – Serge

+0

@Fabske [OperationContract]也適用於缺少的方法。 –

回答

3

請勿使用datacontractserializer無法處理的非可加速類型,例如System.drawing。

相關問題