Pulling MYSQL data into Array - SOAP .asmx

Ulas KAYALAR 236 Reputation points
2021-08-30T12:45:42.917+00:00

Hello,

I need to pull data from Android Java side with web service. But the examples I've looked at on the internet don't match my code. I can't pull the data as I am a beginner in webservice and java. I filled data into DataTable on webservice side. However, in the example I saw, the data was drawn as follows.

What code should I write to get output like this on SOAP webservice side?

127577-cats.png

I am importing data from DataTable like this but what I want is as above.

 public class MG_ATI : System.Web.Services.WebService  
        {  
      
            DataTable atiDT = new DataTable();  
            string connStr ="";  
      
            [WebMethod]  
            public DataTable Ytir()  
            {  
                using (MySqlConnection conn = new MySqlConnection(connStr))  
                {  
                    conn.Open();  
                    using (MySqlCommand cmd = new MySqlCommand("SELECT ID, isAdi, isOlusturulmaTarihi, isDurum FROM is ORDER BY isDurum ASC, isOlusturulmaTarihi DESC", conn))  
                    {  
                        using (MySqlDataReader dr = cmd.ExecuteReader())  
                        {  
                            atiDT.Load(dr);  
                        }  
                        conn.Close();  
      
                    }  
                }  
      
                return atiDT;  
            }  
        }  
  
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,520 questions
0 comments No comments
{count} votes