2017-10-27 9 views
-1

私はFedExの料金サービスに電話をかけようとしています。Add Service ReferenceがUWPで同じコードを生成しないのはなぜですか?

amespace RateWebServiceClient.RateServiceWebReference { 
using System; 
using System.Web.Services; 
using System.Diagnostics; 
using System.Web.Services.Protocols; 
using System.Xml.Serialization; 
using System.ComponentModel; 


/// <remarks/> 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] 
[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.ComponentModel.DesignerCategoryAttribute("code")] 
[System.Web.Services.WebServiceBindingAttribute(Name="RateServiceSoapBinding", Namespace="http://fedex.com/ws/rate/v22")] 
public partial class RateService : System.Web.Services.Protocols.SoapHttpClientProtocol { 

    private System.Threading.SendOrPostCallback getRatesOperationCompleted; 

    private bool useDefaultCredentialsSetExplicitly; 

    /// <remarks/> 
    public RateService() { 
     this.Url = "https://wsbeta.fedex.com:443/web-services/rate"; 
     if ((this.IsLocalFileSystemWebService(this.Url) == true)) { 
      this.UseDefaultCredentials = true; 
      this.useDefaultCredentialsSetExplicitly = false; 
     } 
     else { 
      this.useDefaultCredentialsSetExplicitly = true; 
     } 
    } 

私は私のプロジェクトでそれを生成すると、私は完全に異なるコードを取得する:自分のサンプルアプリでは、彼らのreference.csはRateService()を実装しています。私は古いファッションウェブサービスのオプションを見たことがないことに気づいた。

//------------------------------------------------------------------------------ 
// <auto-generated> 
//  This code was generated by a tool. 
//  Runtime Version:4.0.30319.42000 
// 
//  Changes to this file may cause incorrect behavior and will be lost if 
//  the code is regenerated. 
// </auto-generated> 
//---------------------------------------------------------------------------- 
// 
// This code was auto-generated by Microsoft.VisualStudio.ServiceReference.Platforms, version 15.0.26919.1 
// namespace Carriers.FedExServiceReference { 

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 
[System.ServiceModel.ServiceContractAttribute(Namespace="http://fedex.com/ws/rate/v22", ConfigurationName="FedExServiceReference.RatePortType")] 
public interface RatePortType { 

    [System.ServiceModel.OperationContractAttribute(Action="http://fedex.com/ws/rate/v22/getRates", ReplyAction="*")] 
    [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] 
    System.Threading.Tasks.Task<Carriers.FedExServiceReference.getRatesResponse> getRatesAsync(Carriers.FedExServiceReference.getRatesRequest request); 
} 

/// <remarks/> 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2556.0")] 
[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://fedex.com/ws/rate/v22")] 
public partial class RateRequest : object, System.ComponentModel.INotifyPropertyChanged { 

    private WebAuthenticationDetail webAuthenticationDetailField; 

    private ClientDetail clientDetailField; 

    private TransactionDetail transactionDetailField; 

    private VersionId versionField; 

    private bool returnTransitAndCommitField; 

    private bool returnTransitAndCommitFieldSpecified; 

    private CarrierCodeType[] carrierCodesField; 

    private ServiceOptionType[] variableOptionsField; 

    private ConsolidationKey consolidationKeyField; 

    private RequestedShipment requestedShipmentField; 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=0)] 
    public WebAuthenticationDetail WebAuthenticationDetail { 
     get { 
      return this.webAuthenticationDetailField; 
     } 
     set { 
      this.webAuthenticationDetailField = value; 
      this.RaisePropertyChanged("WebAuthenticationDetail"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=1)] 
    public ClientDetail ClientDetail { 
     get { 
      return this.clientDetailField; 
     } 
     set { 
      this.clientDetailField = value; 
      this.RaisePropertyChanged("ClientDetail"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=2)] 
    public TransactionDetail TransactionDetail { 
     get { 
      return this.transactionDetailField; 
     } 
     set { 
      this.transactionDetailField = value; 
      this.RaisePropertyChanged("TransactionDetail"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=3)] 
    public VersionId Version { 
     get { 
      return this.versionField; 
     } 
     set { 
      this.versionField = value; 
      this.RaisePropertyChanged("Version"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=4)] 
    public bool ReturnTransitAndCommit { 
     get { 
      return this.returnTransitAndCommitField; 
     } 
     set { 
      this.returnTransitAndCommitField = value; 
      this.RaisePropertyChanged("ReturnTransitAndCommit"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlIgnoreAttribute()] 
    public bool ReturnTransitAndCommitSpecified { 
     get { 
      return this.returnTransitAndCommitFieldSpecified; 
     } 
     set { 
      this.returnTransitAndCommitFieldSpecified = value; 
      this.RaisePropertyChanged("ReturnTransitAndCommitSpecified"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute("CarrierCodes", Order=5)] 
    public CarrierCodeType[] CarrierCodes { 
     get { 
      return this.carrierCodesField; 
     } 
     set { 
      this.carrierCodesField = value; 
      this.RaisePropertyChanged("CarrierCodes"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute("VariableOptions", Order=6)] 
    public ServiceOptionType[] VariableOptions { 
     get { 
      return this.variableOptionsField; 
     } 
     set { 
      this.variableOptionsField = value; 
      this.RaisePropertyChanged("VariableOptions"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=7)] 
    public ConsolidationKey ConsolidationKey { 
     get { 
      return this.consolidationKeyField; 
     } 
     set { 
      this.consolidationKeyField = value; 
      this.RaisePropertyChanged("ConsolidationKey"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=8)] 
    public RequestedShipment RequestedShipment { 
     get { 
      return this.requestedShipmentField; 
     } 
     set { 
      this.requestedShipmentField = value; 
      this.RaisePropertyChanged("RequestedShipment"); 
     } 
    } 

    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)); 
     } 
    } 
} 

/// <remarks/> 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2556.0")] 
[System.Diagnostics.DebuggerStepThroughAttribute()] 
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://fedex.com/ws/rate/v22")] 
public partial class WebAuthenticationDetail : object, System.ComponentModel.INotifyPropertyChanged { 

    private WebAuthenticationCredential parentCredentialField; 

    private WebAuthenticationCredential userCredentialField; 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=0)] 
    public WebAuthenticationCredential ParentCredential { 
     get { 
      return this.parentCredentialField; 
     } 
     set { 
      this.parentCredentialField = value; 
      this.RaisePropertyChanged("ParentCredential"); 
     } 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.XmlElementAttribute(Order=1)] 
    public WebAuthenticationCredential UserCredential { 
     get { 
      return this.userCredentialField; 
     } 
     set { 
      this.userCredentialField = value; 
      this.RaisePropertyChanged("UserCredential"); 
     } 
    } 

    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)); 
     } 
    } 
} 

/// <remarks/> 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2556.0")] 
[System.Diagnostics.DebuggerStepThroughAttribute()] 

この新しく刻まれたコードを使用するにはどうすればよいですか?なぜ変化?

答えて

0

この新しいコードを使用するにはどうすればよいですか?

サービスクライアント(プロキシ)のインスタンスを作成し、それを使用してサービスを呼び出すことができます。 this threadを参照することがどのようにについて

ToDoService.RatePortTypeClient client = new ToDoService.RatePortTypeClient(); 

詳細:たとえば(ToDoServiceあなたはこのサービスのクライアント用に定義された名前空間があります)。

なぜ変更されますか?

Reference.csは、自動ツールによって生成されたプロキシです。ダウンロードしているサンプルクライアントアプリは.Net framework 2.0ConsoleApplicationですが、あなたのアプリはUWPアプリです。それらは異なるアプリケーションであり、異なるフレームワークを対象としています。 Reference.csファイルもサンプルアプリケーションでMicrosoft.VSDesignerによって自動生成されていますが、UWPアプリケーションではMicrosoft.VisualStudio.ServiceReference.Platformsによって自動生成されています。

関連する問題