Web Service with array Parameter having issues

285 views Asked by At

I am creating a web service which is taking a jagged array parameter. But when I am running this service, I'm not getting expected output like this:

enter image description here

Instead, I'm getting this Output.

enter image description here

My code:

 [WebMethod(EnableSession = true)]
    public Boolean AddRequestWeeklyReport(String ShopID, Object[][][] arr)
    {
        String ItemName=""; int ShiftID=1; bool check = false;
        //Connection to DB 
        for (int items = 0; items <= 4; items++)
        {

           for (int shifts = 0; shifts <= 1; shifts++)
           {

                int days = 0;
                while(days==0)
                {
                    com.Parameters.AddWithValue("@ShopID", ShopID);
                    com.Parameters.AddWithValue("@ItemName", ItemName);
                    com.Parameters.AddWithValue("@ShiftNo", ShiftID);
                    com.Parameters.AddWithValue("@Sunday", arr[items][shifts][days]);//Sun
                    com.Parameters.AddWithValue("@Monday", arr[items][shifts][days + 1]);//mon
                    com.Parameters.AddWithValue("@Tuesday", arr[items][shifts][days + 2]);//Tue
                    com.Parameters.AddWithValue("@Wednessday", arr[items][shifts][days + 3]);//Wed
                    com.Parameters.AddWithValue("@Thursday", arr[items][shifts][days + 4]);//Thurs
                    com.Parameters.AddWithValue("@Friday", arr[items][shifts][days + 5]);//Fri
                    com.Parameters.AddWithValue("@Saturday", arr[items][shifts][days + 6]);//Sat
                    days = 6;
                    con.Open();
                    int i = com.ExecuteNonQuery();
                    con.Close();
                    if (i >= 1)
                    {
                        check=true;
                    }
                    else
                    {
                        check=false;
                    }
                }
            }
        }
        return check;
    }

Why is it not giving text boxes for array, do I need to do any thing else?

How would I provide Array parameter in web method call?

1

There are 1 answers

0
Vincent F On

That soap client usually doesn't provide a form for complex services. Use another client like SoapUI