Solved

WCF Timeouts

Posted on 2013-07-01
4
474 Views
Last Modified: 2013-08-27
I can't understand it, I'm working on a VS 2010 project with WCF service. I've got a code binding object in the client end:
 binding.ReceiveTimeout = new System.TimeSpan(0, 30, 0);
.SendTimeout = new System.TimeSpan(0, 30, 0);

Open in new window

and the web.config in the server end:
<basicHttpBinding>
          <binding   transferMode="Streamed" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"  name="myServericeName"  receiveTimeout="0:30:00" sendTimeout="00:30:00">

Open in new window

and yet it still times out after 20seconds????
0
Comment
Question by:Silas2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 250 total points
ID: 39353258
Can you post the complete client code as well as WCF server and client web.config?
It seems that you are changing your value elsewhere as the default value is 10 minutes.
0
 

Author Comment

by:Silas2
ID: 39354608
public static  VTeamLinkServiceClient GetClient()
        {
            System.ServiceModel.BasicHttpBinding binding = new BasicHttpBinding();
            binding.MaxReceivedMessageSize = 2147483647;
            binding.TransferMode = TransferMode.StreamedResponse;
            binding.ReceiveTimeout = new System.TimeSpan(0, 30, 0);
            binding.SendTimeout = new System.TimeSpan(0, 30, 0);
            binding.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.None;

            string whichWCF = "zRemote";
            string wcfAddress = "";

            if (whichWCF == "Remote")
            {
                wcfAddress = "http://xxxx/vteamlinkservice.svc/BasicBind";
            }
            else
            {
                wcfAddress = "http://127.0.0.1.:50719/VTeamLinkService.svc/BasicBind";
            }

            EndpointAddress address =
               new EndpointAddress(wcfAddress);

            VTeamLinkServiceClient svc = new VTeamLinkServiceClient(binding, address);
            return svc;
        }

Open in new window


 <system.serviceModel>
   
      <services>
          <service name="VTeamLinkWCFService.VTeamLinkService">
              <endpoint address="/BasicBind" binding="basicHttpBinding" bindingConfiguration="VTeamLinkWCFService.VTeamLinkService.customBinding0"
                  contract="VTeamLinkServiceContracts.IVTeamLinkService" />
          </service>
          <service name="VTeamLinkWCFService.VTeamLinkServiceUtils1">
              <endpoint address="" behaviorConfiguration="VTeamLinkWCFService.VTeamLinkServiceUtils1AspNetAjaxBehavior"
                  binding="webHttpBinding" contract="VTeamLinkWCFService.VTeamLinkServiceUtils1" />
          </service>
      </services>
      <bindings>
        <basicHttpBinding>
          <binding   transferMode="Streamed" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"  name="VTeamLinkWCFService.VTeamLinkService.customBinding0"  receiveTimeout="00:30:00" sendTimeout="00:30:00">
            <security mode="None"/>
            <readerQuotas
              maxDepth="32"
              maxStringContentLength="2147483647"
              maxArrayLength="2147483647"
              maxBytesPerRead="4096"
              maxNameTableCharCount="16384" />
          </binding>
        </basicHttpBinding>
        <wsHttpBinding>
          <binding     maxReceivedMessageSize="2147483647"   name="VTeamLinkWCFService.VTeamLinkService.customBinding2"  receiveTimeout="10:10:00" sendTimeout="10:10:00">
            <security mode="None"/>
          </binding>
        </wsHttpBinding>
  
      </bindings>
      <behaviors>
          <endpointBehaviors>
              <behavior name="VTeamLinkWCFService.VTeamLinkServiceUtils1AspNetAjaxBehavior">
                  <enableWebScript />
              </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
              <behavior name="">
                  <serviceAuthorization principalPermissionMode="None" />
                  <serviceMetadata httpGetEnabled="true" />
                  <serviceDebug includeExceptionDetailInFaults="true" />
              </behavior>
          </serviceBehaviors>
      </behaviors>
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
          multipleSiteBindingsEnabled="true" />
    </system.serviceModel>

Open in new window

0
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 39356405
There is no client config file, I assume that you are setting client in code
In WCF, you must use ChannelFactory to create your client instance as described below:
http://stackoverflow.com/questions/2943148/how-to-programmatically-connect-a-client-to-a-wcf-service
http://msdn.microsoft.com/en-us/library/ms734681(v=vs.100).aspx

Also notice that you are missing the readerQuotas in your client code, check:
http://stackoverflow.com/questions/969479/modify-endpoint-readerquotas-programatically

Note: Your code must define all configuration values defined on the server.
0
 

Author Comment

by:Silas2
ID: 39357439
The ChannelFactory's only necessary if you need multiple endpoint listeners isn't it?
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In previous Articles, we have discussed how we can upload a file using .asmx web service and isolated storage space. Here, in continuation to the topic, I am going to discuss how we can use WCF for the same purpose. Steps: 1.Create the silverli…
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question