502 Bad Gateway error on client when i host my WCF service to the IIS 7.

Hello
When i call wcf service locally, it works fine.
when i call my wcf service hositing it on IIS i get error 502. It happens exactly after 90 secs. So i thing it is some timeout issue...

I tried to change following setting on IIS on mywebsite and default website settings.
In website - connectiontimeout - set to 600 instead of 120
in application pool Ping maximum respond time - 600 instead of 90, ShoutDownTimeLimit = 600 instead of 90 and start uptime limit, instead of 90


I consume WCF through win 8 app client, setting are following:
           
            client.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 3, 0);
            client.Endpoint.Binding.CloseTimeout = new TimeSpan(0, 3, 0);
            client.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 3, 0);
            client.Endpoint.Binding.SendTimeout = new TimeSpan(1, 0, 0);
As i said, it works locally

WCF works through http

What else it can be?
nospanovAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kblauCommented:
You can go into browser and check the lan settings for gateway to use in example below

public class GetProxy
    {
        public static WebProxy GetGovProxy()
        {
            WebProxy intranetPassThrough = new WebProxy();
            intranetPassThrough.BypassProxyOnLocal = true;

#if (!DEBUG)
            intranetPassThrough.UseDefaultCredentials = false;
            ICredentials credentials = new NetworkCredential(ConfigurationManager.
                AppSettings["ProxyUserID"],
                ConfigurationManager.AppSettings["ProxyPassword"]);
            intranetPassThrough.Credentials = credentials;
#endif
#if (DEBUG)
            intranetPassThrough.UseDefaultCredentials = true;
#endif
            intranetPassThrough.Address = new Uri("http://proxy.mycompany.gov:8989");
            return intranetPassThrough;
        }
    }

/*---------------------------------------------------------------------------------------------------------------*/
'client' below could also be a wcf client or an aspx client

WebProxy intranetPassThrough = GetProxy.GetGovProxy();

            WebClient client = new WebClient();
            // in case of time out use the next line instead of previous
            //WebClientEx client = new WebClientEx();
#if (!DEBUG)
            if (Boolean.Parse(ConfigurationManager.AppSettings["UseProxy"]))
            {
                client.Proxy = intranetPassThrough;
            }
#endif
#if (DEBUG)
            client.Proxy = intranetPassThrough;
#endif
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.