web services - WCF calling webservice taking a long time -


i have wcf service (wcf_a ) calls wcf service (wcf_b) (currently hosting wcf_b on local machine credentials – windows service), wcf_b internally makes call webservice (ws01) hosted on iis. have created test client , call wcf_a -> wcf_b -> ws01. before making call (ws01) start timer , stop timer when webservice call comes , result assigned variable, flow below wcf_b

1)  debug.writeline(“call webservice”) 2)  starttimer 3)  var result = ws01.function(xxxx) 4)  stop timer 5)  debug.writeline (timetaken) 6)  debug.writeline(“call webservice came back”) 

the first time make webservice function call find between step (2) , step (5) takes long time.

my initial thought proxy creation taking long time, running fiddler find call webservice made , comes expected results instantly.

after not sure happens , process seems wait. (it takes close 2.5 minutes hit step (5).

once call made if turn around , make same call different parameters webservice step (5) hit in around 1.1 sec (time taken). not sure going on here. appears in step (3) assignment result variable taking lot of time not sure why happens first time.

i have created test client , call wcf_b directly (hosted using wcf provided wcfhost) although call not take long time previous case comes in 9.8 secs first time , around 1 sec after again call seem waiting during assignment.

any pointers on identifying going on?

thanks help

my first guess first call slower because of .net infrastructure itself. wcf compiled intermediary language c# ou vb.net compiler. @ runtime, code compiled native code executed system. called just-in-time compilation , occurs once each method first time executed in application.

so unless, able reproduce behavior describe on 2nd, 3rd or nth call service, think safe assume expected behavior.

  1. you can use profiler trace taking long time execute.
  2. if expect wcf source of problem, enable activity tracing on wcf client , see if can spot delay in list of activities traced.

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -