Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WCF Timeouts

Posted on 2013-07-01
4
Medium Priority
?
477 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 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial will show you how to add an attribute to an XML (http://en.wikipedia.org/wiki/XML) stream returned from a Windows Communication Foundation (http://en.wikipedia.org/wiki/Windows_Communication_Foundation) (WCF) Web Service.  Some knowled…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

722 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