I use .NET 3.5 and WCF to develop a server-client application. Binding = BasicHttp. I work and deploy a service on a Windows 2003 sp2 server.
The service on the server is self-serviced by the console application, and everything works fine on my computer. The fact is that when you deploy the server to the computer, it must start, it must EXACTLY 15 seconds to open the serviceHost instance, when it should be milliseconds. I could live with it, but also, when this instance receives the first request from the client, it takes EXACTLY 15 seconds to respond, and, like this, with each new client. After the first request, it only takes a few milliseconds to answer the following questions.
I do not have this problem on my computer and I have tried many others and it works great. I have no way to format the server on which I am deploying, so I need advice on what might be wrong with this particular computer or configuration. This behavior is repeated using ANY service that I want to host on this computer, even in the basic example in the WCF service template, so for simplicity I am working on this while I am solving this problem. This is the app.config that I use in the main application. The rest of the code is exactly the one above. Please keep in mind that the service is working properly, this is a delay that makes the work unusable.
Thanks in advance!
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" /> </system.web> <system.serviceModel> <services> <service name="WcfServiceLibrary7.Service1" behaviorConfiguration="WcfServiceLibrary7.Service1Behavior"> <host> <baseAddresses> <add baseAddress = "http://localhost:8732/Design_Time_Addresses/WcfServiceLibrary7/Service1/" /> </baseAddresses> </host> <endpoint address ="" binding="wsHttpBinding" contract="WcfServiceLibrary7.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="WcfServiceLibrary7.Service1Behavior"> <serviceMetadata httpGetEnabled="True"/> <serviceDebug includeExceptionDetailInFaults="False" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
App.config Client:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://localhost:8732/Design_Time_Addresses/WcfServiceLibrary7/Service1/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1" name="WSHttpBinding_IService1"> <identity> <dns value="localhost" /> </identity> </endpoint> </client> </system.serviceModel> </configuration>
Nacho source share