.NET Programming
--
Questions
--
Followers
Top Experts
I am having an issue with connecting to a remote web service from a .NET application built using WPF. We can connect successfully and we receive the required information back, however it takes a long time, approx 30-60 seconds to get anything back.
When I run the client application on the machine where the web service is hosted the data is retrieved almost immediately. It appears there may be some network connectivity issue, or possibly a configuration issue with the web service, or IIS which hosts it.
I have reached a dead end. If it was a firewall issue then surely no data would come back, it appears to be just delayed.
If it helps to have any of the config settings let me know.
Any suggestions will be greatly appreciated.
Thanks
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Thanks for the reply. I will turn on the logging which hopefully give me some clue as to what is happening.
I am hosting the service on my machine and a colleague is having the slowness problem. Speed is fine when I access it locally.
can u check whether the web service's application pool managed pipeline mode is classic a or integrated?
Â
Try to set the Managed Pipeline Mode to "Classic" in application pool for this web application. Then restart the website.
additionally check for any recycling is scheduled for this application pool and also check for the RAM size (memory usage) on the server.
test with "managed pipeline mode" setting update and check the service response.
Hope this may help you.
I have enabled the logging as you suggested ambience and I am getting the following exception:
Exception: System.TimeoutException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message: The HTTP request to 'http://mytestdomain.com/ServiceEngine/Service.svc' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.
This request take less than a second when I run the service and client locally from my machine, which is the speed I require. I will do some further investigation and report back any findings






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
http://www.iis.net/ConfigReference/system.applicationHost/applicationPools
are you using IIS 6 or IIS 7?

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2012-02-29T11:42:29.0406671Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{9b171561-3bb0-4307-8c28-89b27fe78657}" /><Execution ProcessName="SMaRTTree.vshost" ProcessID="2004" ThreadID="12" /><Channel /><Computer>PC-QNT-RR-0410</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-IE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>Throwing an exception.</Description><AppDomain>SMaRTTree.vshost.exe</AppDomain><Exception><ExceptionType>System.TimeoutException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The HTTP request to 'http://mydomain.com/PricingEngine/Service.svc' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.</Message><StackTrace> at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
at SMaRTLib.Service.IPricingEngineService.Price(PEGame game)
at SMaRTLib.Service.PricingEngineServiceClient.Price(PEGame game)
at SMaRTLib.Pricing.PECaller.Price(Game game)
at SMaRTLib.Engines.TemplatingEngine.templateGame(Game game)
at SMaRT.SetupScreens.GenericSetup.&lt;btnSetupEvents_Click&gt;b__0(Object s, DoWorkEventArgs args)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp; outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()
at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
</StackTrace><ExceptionString>System.TimeoutException: The HTTP request to 'http://mydomain.com/PricingEngine/Service.svc' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. ---&gt; System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---</ExceptionString><InnerException><ExceptionType>System.Net.WebException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The operation has timed out</Message><StackTrace> at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)</StackTrace><ExceptionString>System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)</ExceptionString></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>
Server WCF Trace Log:
Suspends here:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131085</EventID>
<Type>3</Type>
<SubType Name="Suspend">0</SubType>
<Level>255</Level>
<TimeCreated SystemTime="2012-02-29T11:41:29.6777257Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{9b171561-3bb0-4307-8c28-89b27fe78657}" />
<Execution ProcessName="w3wp" ProcessID="7092" ThreadID="6" />
<Channel />
<Computer>MYCOMPUTER</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Suspend">
<TraceIdentifier>http://msdn.microsoft.com/en-IE/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
<Description>Activity boundary.</Description>
<AppDomain>/LM/W3SVC/1/Root/Service-1-129749888400313453</AppDomain>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
<ActivityName>Process action 'http://tempuri.org/IPricingEngineService/Price'.</ActivityName>
<ActivityType>ProcessAction</ActivityType>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
Transfer here (over two minutes later):
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>0</EventID>
<Type>3</Type>
<SubType Name="Transfer">0</SubType>
<Level>255</Level>
<TimeCreated SystemTime="2012-02-29T11:43:40.1950213Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{314fa458-e418-46ed-939b-a2cb21f84cc5}" RelatedActivityID="{9b171561-3bb0-4307-8c28-89b27fe78657}" />
<Execution ProcessName="w3wp" ProcessID="7092" ThreadID="6" />
<Channel />
<Computer>MYCOMPUTER</Computer>
</System>
<ApplicationData></ApplicationData>
</E2ETraceEvent>
Then finally a resume here:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131085</EventID>
<Type>3</Type>
<SubType Name="Resume">0</SubType>
<Level>255</Level>
<TimeCreated SystemTime="2012-02-29T11:43:40.1950213Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{9b171561-3bb0-4307-8c28-89b27fe78657}" />
<Execution ProcessName="w3wp" ProcessID="7092" ThreadID="6" />
<Channel />
<Computer>MYCOMPUTER</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Resume">
<TraceIdentifier>http://msdn.microsoft.com/en-IE/library/System.ServiceModel.Diagnostics.ActivityBoundary.aspx</TraceIdentifier>
<Description>Activity boundary.</Description>
<AppDomain>/LM/W3SVC/1/Root/PricingEngine-1-129749888400313453</AppDomain>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
<ActivityName>Process action 'http://tempuri.org/IPricingEngineService/Price'.</ActivityName>
<ActivityType>ProcessAction</ActivityType>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
http://stackoverflow.com/questions/784918/asmx-web-service-slow-first-request
and also remove all your breakpoint if set in project then rebuild the project. after that put in IIS.
Try it and see the response time.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I have seen I am getting some warnings as well - "Message not logged because its size exceeds configured quota"
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131083</EventID>
<Type>3</Type>
<SubType Name="Warning">0</SubType>
<Level>4</Level>
<TimeCreated SystemTime="2012-02-29T13:24:13.7047220Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{0b78c678-469e-4a64-8b4a-8bfba6b9f683}" />
<Execution ProcessName="SMaRTTree.vshost" ProcessID="10772" ThreadID="14" />
<Channel />
<Computer>PC-QNT-RR-0410</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
<TraceIdentifier>http://msdn.microsoft.com/en-IE/library/System.ServiceModel.Diagnostics.MessageNotLoggedQuotaExceeded.aspx</TraceIdentifier>
<Description>Message not logged because its size exceeds configured quota</Description>
<AppDomain>SMaRTTree.vshost.exe</AppDomain>
<Source>System.ServiceModel.Dispatcher.OperationFormatter+OperationFormatterMessage/17661119</Source>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTraceRecord">
<MessageProperties>
<AllowOutputBatching>False</AllowOutputBatching>
</MessageProperties>
<MessageHeaders>
<Action d4p1:mustUnderstand="1" xmlns:d4p1="http://www.w3.org/2003/05/soap-envelope" xmlns="http://www.w3.org/2005/08/addressing">http://tempuri.org/IPricingEngineService/PriceGame</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:a2031b74-819e-4db1-a4f6-e9fa18553d3e</MessageID>
<ActivityId CorrelationId="912e3baf-f4e8-4093-bc45-14a57263ecca" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">0b78c678-469e-4a64-8b4a-8bfba6b9f683</ActivityId>
<ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>
</MessageHeaders>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
I noticed later in the logs that I was getting a DB error which my web service was calling.
Turned out it was calling the wrong DB and was causing the delay. Thanks to both of you.
The logs really helped me out here.
.NET Programming
--
Questions
--
Followers
Top Experts
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.