hello
I'm beginner on c#. I'm getting this error:
System.NullReferenceException was unhandled
and my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GittiGidiyor;
using GittiGidiyor.City;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
[B]CityService cityservice = ServiceProvider.getCityService();[/B]
cityServiceResponse response = cityservice.getCities(1, 3, "", "tr");
if (response != null && response.ackCode.ToString().Equals("success"))
{
cityType[] city = response.cities;
foreach (cityType cities in city)
{
Console.WriteLine("citycode :" + cities.trCode + " / cityname :" + cities.cityName);
}
}
else
{
Console.WriteLine("errorid :" + response.error.errorId);
Console.WriteLine("errorcode :" + response.error.errorCode);
Console.WriteLine("errormessage :" + response.error.message);
}
}
}
}
I've bolded line about getting error
I'll be glad if someone help me
thanks