dankyy1
dankyy1

Reputation: 1194

web service accessing wrapper

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 ?

Upvotes: 1

Views: 307

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1062955

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
}

Upvotes: 1

Related Questions