instantiating an object from a web service vs instantiating an object from a regular class

后端 未结 3 1840
礼貌的吻别
礼貌的吻别 2021-01-05 16:30

I have a very basic web service:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace          


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 17:05

    Services created through the older .asmx technology are not singleton instances. This means that each call you make to the server instantiates a new instance of the service each time. Two real solutions, either use static variables (eugh....), or switch to using WCF.

提交回复
热议问题