views:

51

answers:

1

hi i have to use a web service in my solution I have a wrapper static class accessing web service as

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;
    }

and I call this class in code like

Authentication.VerifyPassword(23,"testUser");

First call of code is succeed And after 2nd call the code I got " the operation has timed out" after 2-3 min. waiting ...

How to call a web service ?

+1  A: 

Apart from always returning true, and possibly using using (if the service is IDisposable), I can't see anything obviously wrong.

Have you tried tracing it with fiddler or wireshark to see what is happening at the transport level?

You could try adding using, but while this may tidy things up I'm not sure it will fix this issue:

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