为什么asmx服务响应时间来自代码而不是soap UI

时间:2019-06-17 16:57:57

标签: c# wcf

我正在使用asmx服务在我的应用程序中显示数据。 asmx需要近30秒的时间来返回代码中的响应,而从soap UI花费的时间不超过1秒。下面是我的代码段。

ProxyHelper.cs

Public class ProxyHelper<TService> where ICommunicationObject, IDisposable, new()
{
    public static T using<T>(Function<TService, T> func, string url)
        {
             var bindings = GetBindings();
             var endpointaddress = new EndpointAddress(url);
              using (var service = (TService) Activator.CreateInstance(typeof(TService), new object [] { bindings, endpointaddress }))
               {
                    return func(service);
                }
    }
}

服务电话

public List<Account> DoGetAccounts(int Id)
     {
         var response = List<Account>
ProxyHelper<SoapClient>.Using(proxy => response = proxy.GetAccounts(i), url);
     }

我在这里做错什么了吗?

0 个答案:

没有答案
相关问题