您的位置:程序门 -> .net技术 -> delphi.net



调用servics时.编译通过了.但一点就错...


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


调用servics时.编译通过了.但一点就错...[已结贴,结贴人:noall]
发表于:2007-03-28 17:24:17 楼主
服务端
public   struct   clientdata
{
        public   string   name;
        public   int   id;
}


        [webmethod(cacheduration   =   30,
                description   =   "返回客户记录 ")]

        public   clientdata[]   getclientdata(int   number)
        {
                clientdata[]   clients   =   null;

                if   (number   >   0   &&   number   <=   10)
                {
                        clients   =   new   clientdata[number];
                        for   (int   i   =   0;   i   <   number;   i++)
                        {
                                clients[i].name   =   "client   "   +   i.tostring();
                                clients[i].id   =   i;
                        }
                }
                return   clients;

        }

客户端:
var   call1:servicesoap;
    callcleint:arrayofclientdata;
    i:integer;
begin
    call1:=getservicesoap();
    callcleint:=call1.getclientdata(3);//运行到这里会出错
    for   i   :=   low(callcleint)   to   high(callcleint)   do
          showmessage(format( '%s     ;         %d ',[callcleint[i].name_,   callcleint[i].id]));
end;
发表于:2007-03-29 11:40:551楼 得分:60
sf
发表于:2007-03-29 14:37:352楼 得分:0
有没人帮忙下。。



快速检索

最新资讯
热门点击