因此,我已经添加了服务参考,并且立即出现了此错误。 我什至还没有开始编程。
我什至还没有开始编码并尝试构建解决方案,但这在名为Reference.cs的脚本中给了我错误。
我尝试解决错误,但无济于事
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace test_web_SAP
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
我还包括了我的Visual Studio自动生成的代码
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
namespace test_web_SAP.SAP_WEB_SERVICE {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="urn:sap-com:document:sap:rfc:functions", ConfigurationName="SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK")]
public interface ZWM_MY_I_BARC_STOCK {
// CODEGEN: Generating message contract since the operation ZWM_MY_I_BARC_STOCK is neither RPC nor document wrapped.
[System.ServiceModel.OperationContractAttribute(Action="urn:sap-com:document:sap:rfc:functions:ZWM_MY_I_BARC_STOCK:ZWM_MY_I_BARC_STOCKReq" +
"uest", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse1 ZWM_MY_I_BARC_STOCK(test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest request);
[System.ServiceModel.OperationContractAttribute(Action="urn:sap-com:document:sap:rfc:functions:ZWM_MY_I_BARC_STOCK:ZWM_MY_I_BARC_STOCKReq" +
"uest", ReplyAction="*")]
System.Threading.Tasks.Task<test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse1> ZWM_MY_I_BARC_STOCKAsync(test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest request);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:sap-com:document:sap:rfc:functions")]
public partial class ZWM_MY_I_BARC_STOCK : object, System.ComponentModel.INotifyPropertyChanged {
private string bATCHField;
private string mATERIALField;
private string pLANTField;
private string sPEC_STOCKField;
private string sTOCK_CATField;
private string sTORAGE_BINField;
private string sTORAGE_LOCField;
private string sTORAGE_TYPEField;
private string wAREHOUSE_NOField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
public string BATCH {
get {
return this.bATCHField;
}
set {
this.bATCHField = value;
this.RaisePropertyChanged("BATCH");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
public string MATERIAL {
get {
return this.mATERIALField;
}
set {
this.mATERIALField = value;
this.RaisePropertyChanged("MATERIAL");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)]
public string PLANT {
get {
return this.pLANTField;
}
set {
this.pLANTField = value;
this.RaisePropertyChanged("PLANT");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)]
public string SPEC_STOCK {
get {
return this.sPEC_STOCKField;
}
set {
this.sPEC_STOCKField = value;
this.RaisePropertyChanged("SPEC_STOCK");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)]
public string STOCK_CAT {
get {
return this.sTOCK_CATField;
}
set {
this.sTOCK_CATField = value;
this.RaisePropertyChanged("STOCK_CAT");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)]
public string STORAGE_BIN {
get {
return this.sTORAGE_BINField;
}
set {
this.sTORAGE_BINField = value;
this.RaisePropertyChanged("STORAGE_BIN");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)]
public string STORAGE_LOC {
get {
return this.sTORAGE_LOCField;
}
set {
this.sTORAGE_LOCField = value;
this.RaisePropertyChanged("STORAGE_LOC");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)]
public string STORAGE_TYPE {
get {
return this.sTORAGE_TYPEField;
}
set {
this.sTORAGE_TYPEField = value;
this.RaisePropertyChanged("STORAGE_TYPE");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)]
public string WAREHOUSE_NO {
get {
return this.wAREHOUSE_NOField;
}
set {
this.wAREHOUSE_NOField = value;
this.RaisePropertyChanged("WAREHOUSE_NO");
}
}
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.8.3752.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:sap-com:document:sap:rfc:functions")]
public partial class ZWM_MY_I_FM_BARCODE_MS : object, System.ComponentModel.INotifyPropertyChanged {
private string tYPEField;
private string mESSAGEField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
public string TYPE {
get {
return this.tYPEField;
}
set {
this.tYPEField = value;
this.RaisePropertyChanged("TYPE");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
public string MESSAGE {
get {
return this.mESSAGEField;
}
set {
this.mESSAGEField = value;
this.RaisePropertyChanged("MESSAGE");
}
}
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.8.3752.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:sap-com:document:sap:rfc:functions")]
public partial class ZWM_MY_I_BARC_STOCK_S : object, System.ComponentModel.INotifyPropertyChanged {
private string mATERIALField;
private string sTGE_LOCField;
private string sTGE_TYPEField;
private string sTGE_BINField;
private decimal qUANTITYField;
private string uOMField;
private string bATCHField;
private string sTOCK_CATField;
private string sPEC_STOCKField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
public string MATERIAL {
get {
return this.mATERIALField;
}
set {
this.mATERIALField = value;
this.RaisePropertyChanged("MATERIAL");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
public string STGE_LOC {
get {
return this.sTGE_LOCField;
}
set {
this.sTGE_LOCField = value;
this.RaisePropertyChanged("STGE_LOC");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)]
public string STGE_TYPE {
get {
return this.sTGE_TYPEField;
}
set {
this.sTGE_TYPEField = value;
this.RaisePropertyChanged("STGE_TYPE");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)]
public string STGE_BIN {
get {
return this.sTGE_BINField;
}
set {
this.sTGE_BINField = value;
this.RaisePropertyChanged("STGE_BIN");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)]
public decimal QUANTITY {
get {
return this.qUANTITYField;
}
set {
this.qUANTITYField = value;
this.RaisePropertyChanged("QUANTITY");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)]
public string UOM {
get {
return this.uOMField;
}
set {
this.uOMField = value;
this.RaisePropertyChanged("UOM");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)]
public string BATCH {
get {
return this.bATCHField;
}
set {
this.bATCHField = value;
this.RaisePropertyChanged("BATCH");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)]
public string STOCK_CAT {
get {
return this.sTOCK_CATField;
}
set {
this.sTOCK_CATField = value;
this.RaisePropertyChanged("STOCK_CAT");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)]
public string SPEC_STOCK {
get {
return this.sPEC_STOCKField;
}
set {
this.sPEC_STOCKField = value;
this.RaisePropertyChanged("SPEC_STOCK");
}
}
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.8.3752.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:sap-com:document:sap:rfc:functions")]
public partial class ZWM_MY_I_BARC_STOCKResponse : object, System.ComponentModel.INotifyPropertyChanged {
private ZWM_MY_I_BARC_STOCK_S[] iTEMField;
private ZWM_MY_I_FM_BARCODE_MS mSGField;
/// <remarks/>
[System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)]
[System.Xml.Serialization.XmlArrayItemAttribute("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
public ZWM_MY_I_BARC_STOCK_S[] ITEM {
get {
return this.iTEMField;
}
set {
this.iTEMField = value;
this.RaisePropertyChanged("ITEM");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)]
public ZWM_MY_I_FM_BARCODE_MS MSG {
get {
return this.mSGField;
}
set {
this.mSGField = value;
this.RaisePropertyChanged("MSG");
}
}
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.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
public partial class ZWM_MY_I_BARC_STOCKRequest {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="urn:sap-com:document:sap:rfc:functions", Order=0)]
public test_web_SAP.SAP_WEB_SERVICE.test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK ZWM_MY_I_BARC_STOCK;
public ZWM_MY_I_BARC_STOCKRequest() {
}
public ZWM_MY_I_BARC_STOCKRequest(test_web_SAP.SAP_WEB_SERVICE.test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK ZWM_MY_I_BARC_STOCK) {
this.ZWM_MY_I_BARC_STOCK = ZWM_MY_I_BARC_STOCK;
}
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
public partial class ZWM_MY_I_BARC_STOCKResponse1 {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="urn:sap-com:document:sap:rfc:functions", Order=0)]
public test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse ZWM_MY_I_BARC_STOCKResponse;
public ZWM_MY_I_BARC_STOCKResponse1() {
}
public ZWM_MY_I_BARC_STOCKResponse1(test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse ZWM_MY_I_BARC_STOCKResponse) {
this.ZWM_MY_I_BARC_STOCKResponse = ZWM_MY_I_BARC_STOCKResponse;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ZWM_MY_I_BARC_STOCKChannel : test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ZWM_MY_I_BARC_STOCKClient : System.ServiceModel.ClientBase<test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK>, test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK {
public ZWM_MY_I_BARC_STOCKClient() {
}
public ZWM_MY_I_BARC_STOCKClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public ZWM_MY_I_BARC_STOCKClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public ZWM_MY_I_BARC_STOCKClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public ZWM_MY_I_BARC_STOCKClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse1 test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK.ZWM_MY_I_BARC_STOCK(test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest request) {
return base.Channel.ZWM_MY_I_BARC_STOCK(request);
}
public test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse ZWM_MY_I_BARC_STOCK(test_web_SAP.SAP_WEB_SERVICE.test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK ZWM_MY_I_BARC_STOCK1) {
test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest inValue = new test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest();
inValue.ZWM_MY_I_BARC_STOCK = ZWM_MY_I_BARC_STOCK1;
test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse1 retVal = ((test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK)(this)).ZWM_MY_I_BARC_STOCK(inValue);
return retVal.ZWM_MY_I_BARC_STOCKResponse;
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
System.Threading.Tasks.Task<test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse1> test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK.ZWM_MY_I_BARC_STOCKAsync(test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest request) {
return base.Channel.ZWM_MY_I_BARC_STOCKAsync(request);
}
public System.Threading.Tasks.Task<test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKResponse1> ZWM_MY_I_BARC_STOCKAsync(test_web_SAP.SAP_WEB_SERVICE.test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK ZWM_MY_I_BARC_STOCK) {
test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest inValue = new test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCKRequest();
inValue.ZWM_MY_I_BARC_STOCK = ZWM_MY_I_BARC_STOCK;
return ((test_web_SAP.SAP_WEB_SERVICE.ZWM_MY_I_BARC_STOCK)(this)).ZWM_MY_I_BARC_STOCKAsync(inValue);
}
}
}