I'm trying to count non odd numbers in web service matrices.
At the service I made the following method while web services don't support multidimensional arrays, so I have had to make it as a jagged array;
[WebMethod]
public int AnetaretCift(int [][]cift)
{
int [][] matrica = new int [3][];
int nrcift = 0;
for (int i = 0; i < matrica.GetLength(0); i++)
{
for (int j = 0; j < matrica.GetLength(1); j++)
{
if (matrica[i][j]%2==0)
{
matrica[i][j]++;
}
nrcift = matrica[i][j];
}
}
return nrcift;
}
By the consumer i wrote the following code:
static void Main(string[] args)
{
int[][] matrica = new int[3][];
matrica[0] = new int[3] { 1, 7, 8 };
matrica[1] = new int[3] { -4, 2, 5 };
matrica[2] = new int[3] { 4, 5, -3 };
referenca.Service1 sherbimi = new referenca.Service1();
Console.WriteLine("Anetaret cift të matrices jane: " + sherbimi.AnetaretCift(matrica));
Console.ReadLine();
}
This code doesn't works by me. If anyone knows how to fix this or what argument I have to give to the web method.
Thank you in advance for your reply.
Cheers.