WCF Service called from 2.0 app and setting maxReceivedMessageSize

Discussion in 'ASP .Net Web Services' started by wdudek, Jul 1, 2008.

  1. wdudek

    wdudek Guest

    Hi,

    I need to up the default maxReceivedMessageSize setting in my clients
    calling a wcf service hosted as a web service. This was easily done in the
    3.5 applications we have using the editor. However I cannot find out where to
    make the change to the 2.0 apps that are consuming the site as a web
    reference instead of a service reference, can anyone tell me where to change
    this setting?

    Thanks,

    Bill
     
    wdudek, Jul 1, 2008
    #1
    1. Advertisements

  2. Hi Bill,

    From your description, you created a WCF service's client proxy via the
    NET 2.0 "Add WebReference" approach, and you're wondering how to configure
    the "maxReceivedMessageSize" property for the webservice client proxy
    class, correct?

    Based on my research, by default the webservice client proxy class only
    expose an "Timeout" property which can let you specify the max timeout
    period that can let your client proxy waiting for longrun webmethod call.

    Also, as for webservice, it normally only care about those http level
    settings such as timeout, authentication, proxy or buffer size. And you can
    override the following method in webservice proxy class to get the
    underlying WebRequest object:

    ==============
    protected override System.Net.WebRequest GetWebRequest(Uri uri) {

    WebRequest request = base.GetWebRequest(uri);
    HttpWebRequest httpRequest = request as HttpWebRequest;
    if (httpRequest != null)
    {

    httpRequest.ServicePoint.MaxIdleTime = 3000;
    httpRequest.KeepAlive = false;

    }

    return request;
    }
    =================

    All the available network configuration are on the WebRequest object or its
    "ServicePoint" property.

    here are some other web article which describe this also:

    #Connection left open after the web service request
    http://vidmar.net/weblog/archive/2005/10/23/2310.aspx

    #TCP Connections and Web Service Calls (Reposted from WebServices newsgroup)
    http://forums.msdn.microsoft.com/en/netfxnetcom/thread/d093d602-4c6b-4b02-86
    03-29c556b98cd1/

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
     
    Steven Cheng [MSFT], Jul 2, 2008
    #2
    1. Advertisements

  3. wdudek

    wdudek Guest

    Steven,

    Thanks for the reply, you are correct in that I used Add Web reference
    to generate the proxy from the 2.0 framework application. Since the web
    reference does not support the maxReceivedMessage property does this mean
    that the problem with some of my messages exceeding the default size for a
    service reference will not occur on the 2.0 apps with web references to the
    service? In the mean time I will try to test this on our end.

    Thanks

    Bill
     
    wdudek, Jul 2, 2008
    #3
  4. Thanks for your reply Bill,

    Yes, for webservice client proxy, it is just a normal http client
    component. Generally there is not particular limitation/configuration on
    the receive size. but the timeout setting may affect since for large
    message it may take long time to return. I suggest you first time it by
    setting timeout value to some large value to see whether it works well
    witht large response message/data size.

    Please feel free to let me know if you have got any new results.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
     
    Steven Cheng [MSFT], Jul 3, 2008
    #4
  5. Hi Bill,

    Have you got any further ideas on this?

    I've also discussed with some other webservice engineer and they also said
    that for .net webservice proxy(the webRequest component), it doesn't have a
    receive message size limit like the WCF client.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .
     
    Steven Cheng [MSFT], Jul 7, 2008
    #5
  6. wdudek

    wdudek Guest

    Steven,

    Thanks that answered my question. I apologize for the delay getting abck
    to you, I've been living in the SQL Server forumns and on the phone with
    support for the last week due to some database problems we have been
    experiencing.

    Thanks,
    Bill
     
    wdudek, Jul 13, 2008
    #6
  7. Thanks for your followup.

    I'm glad that everything is going on well.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
     
    Steven Cheng [MSFT], Jul 14, 2008
    #7
  8. wdudek

    K Nguyen Guest

    Hi Steven and Bill,

    I'm getting the same problem as Bill again.

    "The maximum message size quota for incoming messages (65536) has been
    exceeded. To increase the quota, use the MaxReceivedMessageSize property
    on the appropriate binding element."


    Pls let me know how to set time out property to pass the issue.


    Thanks.
     
    K Nguyen, Oct 6, 2008
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.