Matheno
Matheno

Reputation: 4152

Get SOAP request in C#

In my console application I added a service reference to http://www.ibanbic.be/IBANBIC.asmx . The operations in it I need to use.

Now, this is my little piece of code, and from what I saw in tutorials, this should be enough to connect to it and get a value. But the only value I get is "String is Empty".

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(); 

Can anyone give me some more information about what is wrong?

Upvotes: 1

Views: 212

Answers (1)

Jazzy J
Jazzy J

Reputation: 313

Are you passing a valid BBAN or just the string of asterixes? Do you have a sample of valid data?

Calling the web service with data I just mocked up, e.g. (12345, *) looks to return an empty string, so that's what it might return in the event of invalid data.

Upvotes: 2

Related Questions