Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am calling WCF function in Jquery.
service take fraction of second to return list of questions.
but it take 6-7 second to come in success function. How to reduce this time?
plz help.

Jquery call
JavaScript
jQuery.support.cors = true;
        return $.ajax({
            type: _Type,
            data: _Data,
            contentType: _ContentType,
            dataType: _DataType,
            processdata: _ProcessData,
            crossDomain: true,
            async: false,
            url: MyUrl,
            success: function(msg) {
               <big> ServiceGetQuestion(msg);</big>
            },
            error: ServiceFailed
        });

In Wcf Service.
XML
[OperationContract]
     [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
     List<Question> GetAllQuestion();
Posted
Updated 11-Dec-14 3:10am
v2
Comments
ZurdoDev 11-Dec-14 8:02am    
You'll have to troubleshoot it to figure out where it's taking time.

1 solution

Some strategies to speed things up:

Use compression in iis on the web server. Basically moves the overhead to the server, however.

Big O analysis on the web method itself in the service. If you post this code maybe we can assist.
 
Share this answer
 
Comments
rakeshpatil1234 13-Dec-14 2:01am    
my config setting, any thing wrong or need to change?

|system.servicemodel|
|servicehostingenvironment multiplesitebindingsenabled="true"||/servicehostingenvironment|
|bindings|
|basichttpbinding|
|binding name="basic"|
|security mode="None"|
|/security|
|/binding|
|/basichttpbinding|
|webhttpbinding|
|binding name="StreamedRequestWebBinding" bypassproxyonlocal="true" usedefaultwebproxy="false" hostnamecomparisonmode="WeakWildcard" sendtimeout="10:15:00" opentimeout="10:15:00" receivetimeout="10:15:00" maxreceivedmessagesize="9223372036854775807" maxbuffersize="922337203" maxbufferpoolsize="9223372036854775807" transfermode="StreamedRequest"|
|readerquotas maxarraylength="2147483647" maxstringcontentlength="2147483647"||/readerquotas|
|/binding|
|/webhttpbinding|
|/bindings|
|services|
|service name="Service.Service" behaviorconfiguration="ServiceBehaviour"|
|endpoint address="" behaviorconfiguration="web" binding="webHttpBinding" bindingconfiguration="StreamedRequestWebBinding" contract="Service.IService"||/endpoint|
|/service|
|/services|
|behaviors|
|servicebehaviors|
|behavior name="ServiceBehaviour"|
|servicemetadata httpgetenabled="true"||/servicemetadata|
|servicedebug includeexceptiondetailinfaults="true"||/servicedebug|
|/behavior|
|/servicebehaviors|
|endpointbehaviors|
|behavior name="AjaxBehavior"|
|enablewebscript||/enablewebscript|
|/behavior|
|behavior name="web"|
|webhttp||/webhttp|
|/behavior|
|/endpointbehaviors|
|/behaviors|
|/system.servicemodel|

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900