2009-06-16 134 views
1

您好,我必须使用Web服务在我的解决方案 我有一个包装静态类访问Web服务为Web服务访问包装

public static class Authentication 
{ 
    public static bool VerifyPassword(int membershipID, string password) 
    { 
     PCIValidationResult result = CreatePciWebService().ValidatePassword(
       membershipID, password);    
     LoginValidationResult loginValidationResult = 
      (LoginValidationResult)Enum.ToObject(
       typeof(LoginValidationResult), result.ResultCode);   
     return true; 
    } 

    private static PCIWebService CreatePciWebService() 
    {   
     PCIWebService service = new PCIWebService(); 
     service.Url = KioskManagerConfiguration.PciServiceUrl; 
     return service; 
    } 

,我调用这个类的代码 像

Authentication.VerifyPassword(23,"testUser"); 

代码的第一次调用成功并且在第二次调用代码 后2-3分钟后我得到“操作超时”。等待...

如何调用Web服务?

+0

您的意思是返回基于loginValidationResult的东西,而不是真正的每一次? – 2009-06-16 06:53:41

回答

1

除了总是返回true,并且可能使用using(如果服务是IDisposable),我看不到任何明显的错误。

您是否试图用提琴手或wireshark跟踪它以查看传输级别发生了什么?

你可以尝试添加using,但同时,这可能会收拾东西,我不知道它会解决这个问题:

using(PCIWebService svc = CreatePciWebService()) { 
    PCIValidationResult result = svc.ValidatePassword(membershipID, password); 
    //...etc 
}