对方给提供了一个WSDL文件,以下是我生成的代理类,我该怎么调用?下面的类文件是干嘛用的?//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行库版本:2.0.50727.1891
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Serialization;// 
// 此源代码由 wsdl 自动生成, Version=2.0.50727.1432。
// 
/// <res/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="MI_SOAP_SALE_OUTBinding", Namespace="http://PSTC.sinopec.com")]
public partial class MI_SOAP_SALE_OUTService : System.Web.Services.Protocols.SoapHttpClientProtocol {
    
    private System.Threading.SendOrPostCallback MI_SOAP_SALE_OUTOperationCompleted;
    
    /// <res/>
    public MI_SOAP_SALE_OUTService() {
        this.Url = "http://xitest:8000/sap/xi/engine?type=entry&version=3.0&Sender.Service=BS_TES&Int" +
            "erface=http%3A%2F%2FPSTC.sinopec.com%5EMT_SOAP_SALE_OUT";
    }
    
    /// <res/>
    public event MI_SOAP_SALE_OUTCompletedEventHandler MI_SOAP_SALE_OUTCompleted;
    
    /// <res/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://sap.com/xi/WebService/soap1.1", OneWay=true, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
    public void MI_SOAP_SALE_OUT([System.Xml.Serialization.XmlElementAttribute(Namespace="http://PSTC.sinopec.com")] DT_SOAP_SALE_OUT MT_SOAP_SALE_OUT) {
        this.Invoke("MI_SOAP_SALE_OUT", new object[] {
                    MT_SOAP_SALE_OUT});
    }
    
    /// <res/>
    public System.IAsyncResult BeginMI_SOAP_SALE_OUT(DT_SOAP_SALE_OUT MT_SOAP_SALE_OUT, System.AsyncCallback callback, object asyncState) {
        return this.BeginInvoke("MI_SOAP_SALE_OUT", new object[] {
                    MT_SOAP_SALE_OUT}, callback, asyncState);
    }
    
    /// <res/>
    public void EndMI_SOAP_SALE_OUT(System.IAsyncResult asyncResult) {
        this.EndInvoke(asyncResult);
    }
    
    /// <res/>
    public void MI_SOAP_SALE_OUTAsync(DT_SOAP_SALE_OUT MT_SOAP_SALE_OUT) {
        this.MI_SOAP_SALE_OUTAsync(MT_SOAP_SALE_OUT, null);
    }
    
    /// <res/>
    public void MI_SOAP_SALE_OUTAsync(DT_SOAP_SALE_OUT MT_SOAP_SALE_OUT, object userState) {
        if ((this.MI_SOAP_SALE_OUTOperationCompleted == null)) {
            this.MI_SOAP_SALE_OUTOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMI_SOAP_SALE_OUTOperationCompleted);
        }
        this.InvokeAsync("MI_SOAP_SALE_OUT", new object[] {
                    MT_SOAP_SALE_OUT}, this.MI_SOAP_SALE_OUTOperationCompleted, userState);
    }
    
    private void OnMI_SOAP_SALE_OUTOperationCompleted(object arg) {
        if ((this.MI_SOAP_SALE_OUTCompleted != null)) {
            System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
            this.MI_SOAP_SALE_OUTCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        }
    }
    
    /// <res/>
    public new void CancelAsync(object userState) {
        base.CancelAsync(userState);
    }
}/// <res/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://PSTC.sinopec.com")]
public partial class DT_SOAP_SALE_OUT {
    
    private DT_SOAP_SALE_OUTItem1[] sALE_CREDENTIALSField;
    
    /// <res/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    [System.Xml.Serialization.XmlArrayItemAttribute("Item1", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
    public DT_SOAP_SALE_OUTItem1[] SALE_CREDENTIALS {
        get {
            return this.sALE_CREDENTIALSField;
        }
        set {
            this.sALE_CREDENTIALSField = value;
        }
    }
}

解决方案 »

  1.   


    /// <res/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://PSTC.sinopec.com")]
    public partial class DT_SOAP_SALE_OUTItem1 {
        
        private string cREDENCENUMField;
        
        private string dATETIMEField;
        
        private string cSTAIDField;
        
        private string cSTANAMEField;
        
        private string cCODEField;
        
        private string cNAMEField;
        
        private string mAKEMANField;
        
        private string cBUSTYPField;
        
        private string cBUSTYPNAMEField;
        
        private string tCR_CIDField;
        
        private string tCR_CNAMEField;
        
        private string bRGEWField;
        
        private string nTGEWField;
        
        private string vOLUMField;
        
        private string cREDENCEIDField;
        
        private string kUNNRField;
        
        private string mATNRField;
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CREDENCENUM {
            get {
                return this.cREDENCENUMField;
            }
            set {
                this.cREDENCENUMField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string DATETIME {
            get {
                return this.dATETIMEField;
            }
            set {
                this.dATETIMEField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CSTAID {
            get {
                return this.cSTAIDField;
            }
            set {
                this.cSTAIDField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CSTANAME {
            get {
                return this.cSTANAMEField;
            }
            set {
                this.cSTANAMEField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CCODE {
            get {
                return this.cCODEField;
            }
            set {
                this.cCODEField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CNAME {
            get {
                return this.cNAMEField;
            }
            set {
                this.cNAMEField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string MAKEMAN {
            get {
                return this.mAKEMANField;
            }
            set {
                this.mAKEMANField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CBUSTYP {
            get {
                return this.cBUSTYPField;
            }
            set {
                this.cBUSTYPField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CBUSTYPNAME {
            get {
                return this.cBUSTYPNAMEField;
            }
            set {
                this.cBUSTYPNAMEField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string TCR_CID {
            get {
                return this.tCR_CIDField;
            }
            set {
                this.tCR_CIDField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string TCR_CNAME {
            get {
                return this.tCR_CNAMEField;
            }
            set {
                this.tCR_CNAMEField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string BRGEW {
            get {
                return this.bRGEWField;
            }
            set {
                this.bRGEWField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string NTGEW {
            get {
                return this.nTGEWField;
            }
            set {
                this.nTGEWField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string VOLUM {
            get {
                return this.vOLUMField;
            }
            set {
                this.vOLUMField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CREDENCEID {
            get {
                return this.cREDENCEIDField;
            }
            set {
                this.cREDENCEIDField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string KUNNR {
            get {
                return this.kUNNRField;
            }
            set {
                this.kUNNRField = value;
            }
        }
        
        /// <res/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string MATNR {
            get {
                return this.mATNRField;
            }
            set {
                this.mATNRField = value;
            }
        }
    }/// <res/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    public delegate void MI_SOAP_SALE_OUTCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
      

  2.   

    添加 webservice 服务。创建使用 
      

  3.   

    点添加服务引用后生成代理类。
    直接new那个xxxclient的类的对象proxy,然后调用proxy对象的方法。
    用完记得proxy.close();WCF服务引用实例