.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Calling WebService first time take long time...

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ADO.Net

I would like to ask a question about something that bother me for a long time - why when I'm calling web service for a first time the execution is taking long time and after that call next calls are quick. Another question is about resolving this issue - only resolution for me right now is execute some dummy method when I'm starting my app and prepare proxy this way to execute next time but I'm wondering is there any other option?


View Complete Post

More Related Resource Links

WCF calling webservice - assigning return value taking a long time

0 down vote favorite

I have a wcf service (WCF_A ) which calls another wcf service (WCF_B) (currently I am hosting the WCF_B on my local machine with my credentials – as windows service), WCF_B internally makes a call to a webservice (WS01) that is hosted on the IIS. I have created a test client and call the WCF_A -> WCF_B -> WS01. Just before making the call to (WS01) I start a timer and I stop the timer when the webservice call comes back and the result is assigned to a variable, the flow is as below WCF_B

1)  Debug.WriteLine(“Call to webservice”) 
2)  Starttimer 
3)  Var result = WS01.Function(xxxx) 
4)  Stop

WCF Service: takes very long time to start up

Hi, What could be the reasons, why my WCF service takes up to 40 seconds to get started? My service class is set to [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] I am running a thread inside this class. The WCF service gets initialized and opened within the context of this thread. The Initialization: private void InitializeWCFService() {      // initialize servcie base addrresses      this.SetupBaseAddresses();      //MetaData behaviour : allow HttpGet      ServiceMetadataBehavior metaDataBehavior = new ServiceMetadataBehavior();      metaDataBehavior.HttpGetEnabled = true;      // initialize service host instance      this.seviceHost = new ServiceHost(this, this.httpBaseAddress, this.tcpBaseAddress);      // add service endpoints and behavior.      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Tcp), EndpointName);      this.seviceHost.AddServiceEndpoint(typeof(IUpdateServer), this.GetServerBinding(BindingType.Http), EndpointName);      this.seviceHost.Description.Behaviors.Add(metaDataBehavior);      // MEX endpoint      this.seviceHost.AddServic

SharePoint 2007 + PowerPoint gives "Contacting the server for information" for a long time

I've never had this issue for but today all of a sudden I tried to open a PowerPoint document posted to a document library on our SharePoint 2007 site and it gave a message saying "Contacting the server for information" for a long time.  It eventually opened but not until after 5-10 minutes.  Does anyone know what might have caused this?  The file itself is pretty small, only 70KB, and as I said we haven't had this problem before.

Why does it takes such a long time to load a parameter?

Hi all,   I have a parameter which is filled with a set of about 90.000 rows. When running the report, it takes a long time to view the report. While it loads the report the CPU on the client is getting up with 50% and the memory stacks 300 MB. I think that I am doing something wrong as when I run the query directly at the cube, it takes just 9 seconds. Does anybody have coped with this problem? If so, what are the best practices in this? Your help will be greatly appreciated! Daniel

When not open MOSS 2007 site for long time...


Hi all,

I have a web site under constructing using MOSS 2007, when site is not opened for long time, and come some one to open it, MOSS 2007 return error: Error occured, if you have a permission go to webpart editing page to solve the problem...

I don't know why this happen, and how to solve it?



Performance of XBAP in .NET 4 degrades after a long idle time.


A few of my clients are using XBAP application running over .net 4 client profile in IE8. The operating system they use is windows XP (service pack 2 or 3) on all their machines. We've had no issues during install of the .net framework or our XBAP application but many of them are complaining that after keeping the xbap open for a long time their computer begins to slow down considerably. This specially happens when program is left open without using it for some time. On my own development system which is a windows 7 machine with full .net framework installed i haven't experienced such issue.

I checked for resource usage of the application but there is no significant increase in memory usage. The CPU consumption however becomes quite high, which I suspect is the reason for degradation of performance during these episodes. If this was a single case i would have ignored it for some glitch on their system but this is happening on many machines and I suspect this has got something to do with .net framework on xp machines.

I don't see any reason for why this should be happening. Is there any documented bug, report related to this ? Are there any compatibility issues of .net 4 with other common programs running in xp?  Do you have any idea on why this could be happening ? What kind of data should i provide you s

Let the users know that something is being processed in the background as they wait for a long time



I have a listbox that contains a list of items. The user is required to pick the items from this listbox and add them to another which is called selected items listbox. When doing this he needs to check for any duplicate entries as teh available listbox can contain duplicates but not the selected items list. I have 2 buttons "Add" and "Add All" to add items from available to selected list. The code for Add All button is:




Delivering Replicated Transaction take very long time


Hi All

I have pull transactional replication under SQL 2000 to SQL2005, SQL 2000 as publisher and SQL2005 as Subscriber.

I have setup replication with 28 distribution job agent,i used pull transactional replication. every agent contains 1 or more table to be replicate. i have problem with 1 agent replication with 1 table to be replicated, it call ARAccount_Receivable. since initial snapshot distribution agent show message "Delivering Replicated Transaction". the distribution agent was running for 11days, but the data have lastupdate since 3 days ago, means replication was running but very long time delay. this table size have only 32 million data, if compared to the other table with have size more than 100 milion data was running normal.

Below the agent distribution profile 

-BCPBatchSize : 100000

-CommitBatchSize : 1000

-CommitBatchTreshold : 1000

-HistoryVerboseLevel : 1

-KeepAliveMessageInternal : 300

-LoginTimeOut : 1000

-MaxBcpThreads : 10


Restoring Database taking long time in SQL Server 2008 R2 -- some how urgent


Hi all

I have Database size 12GB in SQL Server 2005 and It is backed up.

Now I tring to restore Database in SQL Server 2008 R2(wizard)....it is not at complted after 2hours...still running.


any idea..or help appreciated..



Closing a WCF connection takes a long time when using SSL


I have a very puzzling problem closing WCF connections. We utilize several different protocols for different customers. The most common is net.tcp. We now have a customer that requires SSL encryption of their WCF calls. It does seem to work, but exhibits some strange behavior when we close the connection.

Closing the connection takes a long time. This could be caused by any number of problems, but the strange thing is that the more data that was transmitted on the connection, the longer it takes to close. Connections that get a small amount of data close reasonably fast, but if a large amount of data was transmitted, closing the connection can take as long as actually retrieving the data. It almost seems as if the data is being retransmitted back to the server for verification before the connection is closed.

We are using reliable sessions and Binary over HTTP protocol.

Nested Views execution time, how long does it take to "unpack" the SQL?


We have the case where in a reporting solution for an application it was decided to build a series of reporting views, fair enough. These views are layered, nested several levels deep at times and, not unexpectedly, as our customer's data grows so these views slow...

To complicate matters further, the report SQL may then join several of these top level reporting views to produce the data it needs.

In a recent support request for a slow performing report we ripped the sql out of the report, pasted it into SSMS and while investigating found a join error in the reports SQL that took execution time from ~ 2 minutes down to about 6 seconds...  Regardless of what we did after that we were unable to reduce the time below 6 seconds using our reporting views. Rewriting the SQL against our base tables takes a fraction of a second to return the needed information.

What I need to do is demonstrate where the extra time in getting the results from the views is spent.  My guess is that it is in untangling all the views and then ending up with a less than optimal query plan. Is there anyway to measure how long it takes the server to "unpack" the nested views into a single SQL statement before it can be executed? Knowing how much of the 6 seconds this is accounting for would be helpful to us in our decision making process.



By any chance can we able to optimize the below query.. It is running for long time..


By any chance, can we optimize the below query..This is running for 2 hrs..As of now, i really don't have any execution plans. 

If i replace "IN" with "Exists", i am saving few minutes. Can someone please optimize the query little more?
SELECT pm.pm_no,
eam_od_pm_tb pm, 
eam_od_location_tb loc
pm.site_id in ('ALF','BRF', 'COF','CUF','GAF','JOF','JSF','KIF','SHF','WCF', 

SSRS taking a long time to run an MDX query



I have an MDX query which runs fine in the MDX Sample Application. It runs against an SSAS 2000 cube. In my query there is a recursion kind of a logic. It takes about 1-2 sec to run in the MDX Sample Application. My sample application is in the same server as my AS 2000 cube is. However when I run the same MDX from another server through BIDS (2008) it takes an unusually long amount of time to run. Most of the time it times out. :(

As a workaround I created 4 calculated members in my Cube itself (Initially these were used as members in my MDX). I thought that maybe the recursion logic is the culprit so I modified my MDX, removed the recursion part. But still from my SSRS it is taking a long time.

Any pointers to where I am missing the trick ?

Thanks in advance,


ASP.NET upgrade seems to be taking a very long time to start


At work I'm tryhing to upgrade an ASP.NET 2.0 app (which we wrote using VB.NET 2005) to ASP.NET 4.0.  I had a few problems during the upgrade, but eventually worked them all out.  At the end of the day I decided to give it a quick compile and see if I'd get the start page, so I hit F5 in VS 2010.  I left it that way, and man was it acting weird.  VS 2010 wasn't responding to anything.  If I hovered the mouse over VS 2010's minimize or close buttons, in the upper right corner, then those buttons were flashing very rapidly.  I'm not sure what was going on.  After waiting 15 minutes to see if it would come up, I decided to try clicking on the close button.  Nothing happened.  Eventually, I had to leave (I take public transit, and I have to leave when the bus comes), but I thought I'd leave it going as is, in hopes that it might fix itself.

But what I want to know is this, is this pretty standard behavior?  Does it normally take this long to do this?  This website is of modest size (<100 pages).

SQL Query is taking long time to run


Hi All,
SQL Query is taking long time to run in my report. It is using Clustered index seek when I am querying for 2 days on invoice_itemized table. It is returning 99 thousand records. It is returning  2524094 records and it is using clustered index scan when I am querying for one month. For one month It is taking 7 minutes.
Basically it is not using the index defined for the store_Id, status and datetime columns in the invoice_totals table. Can I force the sql query to use the specified index?

Please suggest me to improve the performance....

SQL Query

,Invoice_Totals.DateTime InvoiceDate
,Invoice_Totals.Discount InvDiscPercent
,Invoice_Itemized.LineDisc LineDiscPercent
WHEN Invoice_Totals.Total_Price <> 0 AND Inventory.ItemType=7 AND Invoice_Totals.Discount = 0 THEN ((Invoice_Itemized.PricePer * Invoice_Itemized.Quantity) * -1) / ((Invoice_Totals.Total_Price) + ((Invoice_Itemized.PricePer * Invoice_Itemized.Quantity) * -1))
WHEN Invoice_Totals.Total_Price <> 0 AND Inventory.ItemType=7 THEN ((Invoice_Itemized.PricePer * I

SSIS Package Validation Taking Long Time



The package that I am workin on used to open in BIDS real quickly and also when running it through BIDS. Now, it is taking a long time to open in BIDS and also when I am executing it using DTEXEC it is taking more than 60 minutes just for validation.

I dont consider it as heavy as it has fewer tasks compared to other packages and they open really quickly. And also I can open the package to work offline, but have issue with it while executing the package using DTEXEC.

I have tried DelayValidation=TRUE, but it is not much of a help.



Panel Arrange override calling with infinite time



I have a panel for containing the items. If I change any one item visibility to Collapsed, then Arrangeoverride method in the panel getting invoke  infinite times. Wt may be the cause for this????



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend