C# WSDL命名空间中的SAP使用者代理+错误

C# WSDL命名空间中的SAP使用者代理+错误,c#,asp.net,soap,wsdl,abap,C#,Asp.net,Soap,Wsdl,Abap,在我的学士学位论文中,我从几天开始尝试解决在ABAP中创建消费者代理的问题 我想实现一个asp.NETWebService。此aps.Net WS从SQL Server获取一些测试数据并将其传输到SAP 当我尝试创建消费者代理时,会收到以下错误消息: 值不正确:命名空间未知 CX_类SLIB的例外情况 错误位置:C:\Users…\Desktop\KonWebService.wsdl中的第3行第3列错误位置的路径:定义/类型 WSDL可以在下接收,以下是WSDL中与类型相关的部分: <ws

在我的学士学位论文中,我从几天开始尝试解决在ABAP中创建消费者代理的问题

我想实现一个asp.NETWebService。此aps.Net WS从SQL Server获取一些测试数据并将其传输到SAP

当我尝试创建消费者代理时,会收到以下错误消息:

值不正确:命名空间未知 CX_类SLIB的例外情况 错误位置:C:\Users…\Desktop\KonWebService.wsdl中的第3行第3列错误位置的路径:定义/类型

WSDL可以在下接收,以下是WSDL中与类型相关的部分:

<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema"
      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
      xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
      xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
      xmlns:tns="http:/www.w3.org/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      targetNamespace="http:/www.w3.org/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http:/www.w3.org/">
      <s:element name="GetLatestKonData">
        <s:complexType/>
      </s:element>
      <s:element name="GetLatestKonDataResponse">
        <s:complexType/>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="GetLatestKonDataSoapIn">
...
我在编码和Web服务方面是一个相当初级的人,目前我不知道如何解决这个错误。互联网上有很多解决方案,但没有一个能真正帮助我

这里有人能帮我吗?多谢各位

这是我的c/asp.net代码

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
//using System.Web.Script.Serialization;
using System.Web.Services;


namespace QueryApp
{
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // Wenn der Aufruf dieses Webdiensts aus einem Skript zulässig sein soll, heben Sie mithilfe von ASP.NET AJAX die Kommentarmarkierung für die folgende Zeile auf. 
    // [System.Web.Script.Services.ScriptService]

    public class KonWebService : System.Web.Services.WebService
    {           
        [WebMethod(Description = "Get all Data from KonTable")]
        public DataSet GetLatestKonData()
        {
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString))
            {
                string Query = "SELECT * FROM KonTable";
                SqlCommand command = new SqlCommand(Query, connection);
                command.CommandType = CommandType.Text;
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();

                DataTable konTable = new DataTable("KonsolidationData");

                while (reader.Read())
                {
                    konTable.Load(reader);
                    konTable.AcceptChanges();
                    DataSet ds = new DataSet();
                    ds.Tables.Add(konTable);
                    ds.AcceptChanges();
                    return ds;
                }
                connection.Close();
            }
            return null;
        }
    }
}

当然,错误在类型部分XSD中。SAP并不支持所有内容,在这种情况下,SAP会指示编辑XSD,以便SAP可以使用它。我看到XSD定义了递归元素,SAP不支持它,您应该将它们定义为xs:any元素,并在代理中将其映射到ABAP XSDANY元素。感谢您的帮助。我将尝试将其调整为xs:any。我看不懂SAP的说明。我没有S用户,因为我只能访问培训系统。我已经根据堆栈溢出规则编辑了您的问题,将消息作为文本而不是图像包含,并将WSDL的相关部分包含在问题中而不是外部源,但我意识到这太晚了,因为您已经更改了WSDL,所以也许这让这个问题现在过时了。请核实。