Geeks With Blogs

News This is the *old* blog. The new one is at blog.sixeyed.com
Elton Stoneman
This is the *old* blog. The new one is at blog.sixeyed.com

[Source: http://geekswithblogs.net/EltonStoneman]

WCF bindings provide the MaxReceivedMessageSize property, which lets you block any incoming messages on the client side over a given size (defaulting to 64Kb). If you're using message-based itinerary processing with ESB Guidance, when a WCF service returns a message larger than this default, you'll get a System.ServiceModel.QuotaExceededException and the response message will be suspended:

System.ServiceModel.CommunicationException: 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. ---> System.ServiceModel.QuotaExceededException: 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.

Setting the MaxReceivedMessageSize property is straightforward in a configured WCF port, but in ESB Guidance the port is configured dynamically and there's no straightforward way to interrupt it and add your own WCF bindings. To give us access to the message and the port, we replaced the "DynamicSendResponse" port used in the GlobalBank.ESB sample with a simple orchestration.

The orchestration has a direct-bound receive port filtering on the usual properties:

(Microsoft.Practices.ESB.Itinerary.Schemas.ServiceName == "DynamicResolutionSolicitResp") &&

(Microsoft.Practices.ESB.Itinerary.Schemas.ServiceState == "Pending") &&

(Microsoft.Practices.ESB.Itinerary.Schemas.ServiceType == "Messaging")

 

- it then builds the outgoing message for the service, and configures the dynamic send/receive port. At this point the message has all the properties you need configured by ESB (via the resolver pipeline component in the previous itinerary steps), so you can extract them to configure the port, and add any WCF binding configuration you need.

We store the configuration in the Enterprise Single Sign-On application config store using SSO Config Tool, so the expression to build the outgoing message and increase the received message size looks like this –

//setup port from context properties:

sptServiceProvider(Microsoft.XLANGs.BaseTypes.Address) = ServiceProviderRequest(BTS.OutboundTransportLocation);

sptServiceProvider(Microsoft.XLANGs.BaseTypes.TransportType) = ServiceProviderRequest(BTS.OutboundTransportType);

 

//set message size from config:

maxReceivedMessageSize = x.y.z.Configuration.X_Y_Z_Config.WCFMaxReceivedMessageSize;

ServiceProviderRequest(WCF.MaxReceivedMessageSize) = maxReceivedMessageSize;

Microsoft.Practices.ESB.Adapter.AdapterMgr.SetMsgProperty(ServiceProviderRequest, typeof(WCF.MaxReceivedMessageSize), maxReceivedMessageSize);

 

//set timeout from config:

sendTimeout = x.y.z.Configuration.X_Y_Z_Config.WCFSendTimeout;

ServiceProviderRequest(WCF.SendTimeout) = sendTimeout;

 

Note that the WCF config is set on the message, not on the port. We're also setting timeout values here. When you're dealing with large messages, you may get operation timeouts as the default binding config from BizTalk is set to a pessimistic 1 minute. Value WCF.SendTimeout specifies how long the BizTalk client waits for a response, and WCF.ReceiveTimeout how long the BizTalk client allows for the reception of a request. If your WCF service is hosted in IIS and is long-running, you may also have an issue with IIS controlling execution times. See: Why changing SendTimeout does not help for hosted WCF services.

Posted on Wednesday, February 25, 2009 5:51 PM ESB Guidance , WCF | Back to top


Comments on this post: Receiving large WCF response messages in ESB Guidance

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
just created a video and uploaded for the easy kindly download the same and you will get the idea regarding the buffer size, or maximassagesize issue, or maxarraylength etc.

http://dc153.4shared.com/download/104448179/ab2b182d/wcfandlargedata.mp4

for further videos --

http://www.elearningfromhome.com/Sample_Videos.html
Left by maruti on May 13, 2009 5:44 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Nice Post,thanks for share!Restore Deleted Files|进程保护
Left by jmail on Mar 04, 2010 3:23 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Nice Post,thanks for share!Data Recovery Software|Guard Process
Left by ddark on Mar 04, 2010 3:24 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Hey, you have a great blog here! I'm definitely going to bookmark you!Each & every tips of your post are awesome.Thanks a lot.Keep sharing your views.
Left by Sram Red on Mar 04, 2010 6:28 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Amazing themes, will these work for my game website? , looking for good design. Thanks for sharing this post with us.
Left by storesonline on Apr 24, 2010 8:00 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
A binding defines how an endpoint communicates to the world. It can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint.
Left by Lipo on Feb 18, 2011 12:37 PM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
This article gives the light in which we can observe the reality. This is very nice one and gives in depth information. Thanks for this nice article. Good post.....Valuable information for all.
Left by Sacramento Carpet Repair on Mar 12, 2011 6:25 PM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
We are looking for crucial information on this subject. The information was important as we are about to launch our own portal. Many thanks for providing a missing link in my business..its a pleasure and a great experience..
Left by electric tankless water heaters on Mar 13, 2011 11:33 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Your blog is very knowledgeable information, It could be very helpful in IT as well as e-business industry. Keep the great work. Thanks!
Left by Phentramin-D on Mar 21, 2011 12:27 PM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
After I read your article, I was quite interested in what you write because it is very useful for me. I really am learning about this and your article was very helpful to me.
Left by accredited online degrees on Mar 22, 2011 5:26 PM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck!!
Left by Fort Worth Carpet Repair on Mar 27, 2011 5:28 AM

# re:Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Wow thanks for this. I appreciate the amount of time it must have taken to write this.
Left by George Goodman on May 15, 2011 7:37 PM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
The power of the internet can not be put into words, the world is surely becoming a much smaller place... this is a good topic of discussion and hope your success rubs off...
Indian escorts London
Left by Escorts in London on Jun 05, 2011 12:14 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
A binding defines how to communicate with one end of the world. May contain binding elements that specify details like the security mechanisms used to protect messages or the message pattern used by an endpoint.
Just Dreams Reviews
Left by Ian on Jun 14, 2011 11:21 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Very good tips...It's provided a couple but it would be nice if you went into a little more detail about it..
Left by driving lessons Birmingham on Jun 17, 2011 3:54 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
hmmm thanks for sharing such a nice information
please keep it up dude
Left by freetress on Jun 18, 2011 9:40 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
I admire the valuable information you offer in your articles.I am very impressed with the article I have just read.Thanks a lot.
Left by forex on Jun 27, 2011 4:38 AM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Enkelt alternativ for å få nyttig informasjon og å dele ideer. Jeg var veldig glade over å finne dette nettstedet. Jeg ønsket å takke deg for denne store lese! Jeg definitivt nøt hver lille bit av det, og jeg har dere bokmerkelinkene å sjekke ut nye ting du poster.
Left by Konstali Helsenor on Aug 05, 2011 6:52 PM

# re: Receiving large WCF response messages in ESB Guidance
Requesting Gravatar...
Your article is very topical for me..I’ll be checking in on a regularly now….Keep up the good work!
Left by copy wii games on Sep 22, 2011 7:15 AM

Your comment:
 (will show your gravatar)


Copyright © Elton Stoneman | Powered by: GeeksWithBlogs.net