在 C# 中获取 SOAP 请求
本文关键字:SOAP 请求 获取 | 更新日期: 2023-09-27 18:34:28
在我的控制台应用程序中,我添加了对 http://www.ibanbic.be/IBANBIC.asmx 的服务引用。我需要使用其中的操作。
现在,这是我的一小段代码,从我在教程中看到的内容来看,这应该足以连接到它并获得一个值。但我得到的唯一值是"字符串为空"。
using (BANBICSoapClient WebService = new BANBICSoapClient())
{
string bban = "*****";
try
{
string resultIban = WebService.BBANtoIBAN(bban);
if (resultIban != string.Empty)
{
Console.WriteLine(resultIban);
}
else
{
Console.WriteLine("String is empty.");
}
}
catch(Exception msg)
{
Console.WriteLine(msg);
}
}
Console.ReadLine();
谁能给我更多关于问题的信息?
您是通过有效的 BBAN 还是只是一串星座? 您有有效数据样本吗?
使用我刚刚模拟的数据调用 Web 服务,例如 (12345, *( 看起来会返回一个空字符串,所以这就是它在出现无效数据时可能返回的内容。