c# - SAP 消费者代理 + WSDL 命名空间中的错误
问题描述
对于我的学士论文,我从几天前开始尝试解决在 ABAP 中创建消费者代理的问题。
我想实现一个asp.Net Webservice。此 aps.Net WS 从 SQL Server 获取一些测试数据并将其传输到 SAP。
当我尝试创建消费者代理时,我收到以下错误消息:
值不正确:未知命名空间http://www.w3.org/2001/XMLSchema
CX_SLIB 类异常
错误位置:C:\Users...\Desktop\KonWebService.wsdl 中的第 3 行第 3 列错误位置的路径:定义/类型
可以在http://62.171.132.65/KonQuery/KonWebService.asmx?WSDL下接收 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;
}
}
}
解决方案
推荐阅读
- web-services - 如何将值从 html 页面传递到简单的 java 类
- java - MongoDB,2个查询的共同部分
- firebase - 为什么 for 循环在离子 ionViewWillEnter 方法中不起作用
- cmis - 获取具有特定 Aspect 属性值的文件夹或站点中的所有文档?
- bash - Bash basename 只返回文件夹列表中的姓氏
- c++ - 具有多个模板说明符的函数
- asp.net-mvc - 如何使用实体框架通过 asp.net mvc 将 csv 文件导入数据库
- angular - 如何在角度 6 中取消订阅计时器?
- java - 从Android中的JSON对象中排序JSON数组?
- python - 如何检索蓝牙树莓信标的 TxPower?