By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

WCF Byte Array Limitation in XBAP

P: n/a
I observed that WCF client running inside Full Trust mode XBAP application
can't read byte array over 16384. If return result is bigger than that size,
then client simply get null or Nothing in VB and there are no exceptions. I
have tried increasing limits on both client and server. Here is a typical
entry:

<binding name="myBasicHttpBinding"
maxBufferSize="2097152" maxBufferPoolSize="8388608"
maxReceivedMessageSize="2097152"
transferMode="Buffered">
<readerQuotas maxDepth="32" maxStringContentLength="2097152"
maxArrayLength="2097152"
maxBytesPerRead="3097152"
maxNameTableCharCount="2097152" />
</binding>

I also tried changing to transferMode="stream".

I have found that WCF call would work when XBAP is started from Visual
Studio 2008. WCF client would not work if started when deployed to IIS
server. I also experimented with presentationhost.exe invocations. Here are
results:

Call works:

presentationhost.exe -debug -debugSecurityZoneURL http://myhostname
"C:\fullpath\bin\Debug\app.xbap"

Call returns null:

presentationhost.exe http://myhostname/virtualDir/version/app.xbap

In the end I gave up and decided to try out returning String. I had no
problem with large size strings. So, for the moment I seem to have only one
option and that is to return Base64Encoded string. It seems like a waste.

So, how do I configure WCF to transmit large byte arrays? The goal I have
here is to send large binary file from server to XBAP client.

I am also concerned that this limitation affects all types of arrays. I've
seen somewhere that I can configure some behavior attribute related to byte
array size, so may be that is the answer...

Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi lzorich,

From your description you're using WCF for remote commucation in a WPF
XBAP application. However, you found that when the size of the data sent
exceed a certain amount, the client-side can not receive the data without
any explicit error, correct?

Based on my experience, there are some common data receive/send issue which
is due to the maxReceiveBuffer size or send size and it will result
explicit error. As for the problem, are you encountering it in this
particular project only or even if you try calling the wcf service in a
simple console project?

Also, have you tried using some network trace utility to see whether the
actual data has been arrived the client-side over http channel?

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:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?SXpvcmljaA==?= <Iz*****@nospam.nospam>
Subject: WCF Byte Array Limitation in XBAP
Date: Mon, 21 Apr 2008 10:00:01 -070

I observed that WCF client running inside Full Trust mode XBAP application
can't read byte array over 16384. If return result is bigger than that
size,
then client simply get null or Nothing in VB and there are no exceptions. I
have tried increasing limits on both client and server. Here is a typical
entry:

<binding name="myBasicHttpBinding"
maxBufferSize="2097152" maxBufferPoolSize="8388608"
maxReceivedMessageSize="2097152"
transferMode="Buffered">
<readerQuotas maxDepth="32" maxStringContentLength="2097152"
maxArrayLength="2097152"
maxBytesPerRead="3097152"
maxNameTableCharCount="2097152" />
</binding>

I also tried changing to transferMode="stream".

I have found that WCF call would work when XBAP is started from Visual
Studio 2008. WCF client would not work if started when deployed to IIS
server. I also experimented with presentationhost.exe invocations. Here are
results:

Call works:

presentationhost.exe -debug -debugSecurityZoneURL http://myhostname
"C:\fullpath\bin\Debug\app.xbap"

Call returns null:

presentationhost.exe http://myhostname/virtualDir/version/app.xbap

In the end I gave up and decided to try out returning String. I had no
problem with large size strings. So, for the moment I seem to have only one
option and that is to return Base64Encoded string. It seems like a waste.

So, how do I configure WCF to transmit large byte arrays? The goal I have
here is to send large binary file from server to XBAP client.

I am also concerned that this limitation affects all types of arrays. I've
seen somewhere that I can configure some behavior attribute related to byte
array size, so may be that is the answer...
Jun 27 '08 #2

P: n/a
Hi Lzorich,

Have you got any progress on this issue?

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:
ms****@microsoft.com.

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

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

--------------------

From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Tue, 22 Apr 2008 09:10:27 GMT
Subject: RE: WCF Byte Array Limitation in XBAP
Hi lzorich,

From your description you're using WCF for remote commucation in a WPF
XBAP application. However, you found that when the size of the data sent
exceed a certain amount, the client-side can not receive the data without
any explicit error, correct?

Based on my experience, there are some common data receive/send issue which
is due to the maxReceiveBuffer size or send size and it will result
explicit error. As for the problem, are you encountering it in this
particular project only or even if you try calling the wcf service in a
simple console project?

Also, have you tried using some network trace utility to see whether the
actual data has been arrived the client-side over http channel?

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:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #3

P: n/a
Hi:

Could you elaborate on the alternative solution you have suggested?
I have a Silverlight client that uses a WCF service. On my dev machine, like you mentioned, everything works good. On production it just doesn't work. So, I tried your "encoding" idea, but failed implementing it. Can you help?

Thanks

--tolga
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.