السلام عليكم
انا عمت Web Service و عرفت فيها Static string []
و عندى Method اسمها Add بتاخد String و تحطو فالـ Array
المشكلة انى اما اعمل return للـArray بلاقى كل الـelements Null
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
static string [] Names;
static int count;
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
Names = new string[10];
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
public void AddName(string str)
{
Names[count] = str;
count++;
}
[WebMethod]
public string[] GetArray()
{
return Names;
}