WCF Service called from 2.0 app and setting maxReceivedMessageSize

W

wdudek

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
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).

==================================================
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.
--------------------
 
W

wdudek

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
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).

==================================================
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.


--------------------
From: =?Utf-8?B?d2R1ZGVr?= <[email protected]>
References: <[email protected]>
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).
 
W

wdudek

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
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).

==================================================
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.

--------------------
Subject: RE: WCF Service called from 2.0 app and setting maxReceivedMessage
Date: Sun, 13 Jul 2008 13:59:43 -0700
 
K

K Nguyen

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top