Wcf returns "success" just for first time and subsequent calls return "timeout" -


i researched problem couldn't find useful result. tried configure web.config , iis configurations (disabling cache etc.) result negative. when make request restful using wcf, of wcf methods works fine everytime of wcf methods work first time returning success, subsequent calls' results return "timeout".

when restart iis , , end iis worker task on task manager , debug wcf service, troubled methods work fine first time.

please me

thank in advance

for ex:

[request] localhost/service1.svc/getdata?value=8

[response] "you entered: 8"

getdata method works fine

but arm method;

[request first] localhost/service1.svc/arm?pass=1234&type=2

[response first] {"data":true,"error":false,"message":"success"}

[request subsequents] localhost/service1.svc/arm?pass=1234&type=2

[response subsequents] {"data":false,"error":true,"message":"request timeout. please try again later"}

---service1.svc.cs---

 [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)]      [servicebehavior(includeexceptiondetailinfaults = true, instancecontextmode = instancecontextmode.percall)]      public class service1 : iservice1     {         [webinvoke(method = "get",         requestformat = webmessageformat.json,         responseformat = webmessageformat.json,         uritemplate = "getdata?value={value}")]         //stable method         public string getdata(int value)         {              return string.format("you entered: {0}", value);         }          [webinvoke(method = "get",         requestformat = webmessageformat.json,         responseformat = webmessageformat.json,         uritemplate = "arm?pass={pass}&type={type}")]         //troubled method         public returntype<bool> arm(string pass, int type)         {             paradoxfunctions pf = new paradoxfunctions(pass);             returntype<bool> ret = new returntype<bool>();              paradoxreturn pr = pf.armpanel(type);              if (pr.success)             {                 ret.error = false;                 ret.message = pr.message;                 ret.data = true;             }             else             {                 ret.message = pr.message;             }              return ret;         }      } 

---web.config---

<?xml version="1.0" encoding="utf-8"?> <configuration>    <appsettings>     <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true"/>   </appsettings>     <system.webserver>   </system.webserver>   <system.web>     <compilation debug="true" targetframework="4.0"/>                           <httpruntime targetframework="4.0" requestvalidationmode="2.0" maxrequestlength="65536000"/>                           <pages validaterequest="false" />     <httpmodules>           <add name="applicationinsightswebtracking" type="microsoft.applicationinsights.web.applicationinsightshttpmodule, microsoft.ai.web"/>     </httpmodules>   </system.web>   <system.servicemodel>       <bindings>       <webhttpbinding>         <binding maxreceivedmessagesize="65536000" transfermode="streamedrequest">           <security mode="none" />         </binding>       </webhttpbinding>     </bindings>       <behaviors>       <endpointbehaviors>         <behavior>           <webhttp defaultoutgoingresponseformat="json"/>         </behavior>       </endpointbehaviors>       <servicebehaviors>         <behavior>           <!-- avoid disclosing metadata information, set values below false before deployment -->           <servicemetadata httpgetenabled="true" httpsgetenabled="true"/>           <!-- receive exception details in faults debugging purposes, set value below true.  set false before deployment avoid disclosing exception information -->           <servicedebug includeexceptiondetailinfaults="false"/>         </behavior>       </servicebehaviors>     </behaviors>     <protocolmapping>       <add binding="webhttpbinding" scheme="http"/>     </protocolmapping>     <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" minfreememorypercentagetoactivateservice="0" />   </system.servicemodel>   <system.webserver>     <modules runallmanagedmodulesforallrequests="true">       <remove name="applicationinsightswebtracking"/>     </modules>     <!--         browse web app root directory during debugging, set value below true.         set false before deployment avoid disclosing web app folder information.       -->     <directorybrowse enabled="true"/>     <validation validateintegratedmodeconfiguration="false"/>   </system.webserver>    <runtime>      <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">        <dependentassembly>          <assemblyidentity name="system.net.http.primitives" publickeytoken="b03f5f7f11d50a3a" culture="neutral"/>          <bindingredirect oldversion="0.0.0.0-4.2.28.0" newversion="4.2.28.0"/>        </dependentassembly>      </assemblybinding>    </runtime> </configuration> 


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -