0

I have a wcf service in remote server which validating studentId, actually it works, no problem about process, the think is the it waits too long for "first execution" after that it runs fast(actually normal speed).

So my problem seems about proxy request pass over since I try service with unique values if after first execution it runs fast again.. this makes me think issue possibly about proxy authorization.. it runs extremly slow(50-70 seconds) for first execution after iis restart

here is the code piece that cause this issue, please share any solution or idea about solve it

ValidateStudentService srvc = channelFactory.CreateChannelWithIssuedToken(StudentServiceFactory.Instance.CreateToken());

I need a satisfiyng solution.. adding manually first run attempt is not an option.

TyForHelpDude
  • 4,828
  • 10
  • 48
  • 96

1 Answers1

1

Usually the first call takes more time because in that call the Channel Factory is instantiated and prepared ready for the communication and that costs time. The created Channel Factory will be cached and reused in subsequent calls and so the time will be less.

Have a look at these MSDN posts:

How to cache ChannelFactory?

WCF first call seems to be very slow from the client. Any idea?

Also the post WCF Performance Slow for the first call and Shaun's answer probably helps you.

Community
  • 1
  • 1
StackUseR
  • 884
  • 1
  • 11
  • 40