Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > WPF и Silverlight > SilverLight 2.0 + WCF + SQL + LoadPicture


Автор: AnTON_G 5.6.2008, 08:47
на MS SQL сервере есть тестовая база пользователей int Id, varchar(50) Name, image Foto. Написал WCF принимая на вход Id из базы вытаскивает Name, Foto и формирует класс User и передает в SilverLight. Сервис работает нормально SilverLight 2.0 отказывается принимать сообщения длинна которых больше 65536, меньше принимает.
Конфиг WCF для SilverLight 2.0
Код

<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService1" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="true" bypassProxyOnLocal="false"
                    maxBufferSize="200000000" maxBufferPoolSize="200000000" maxReceivedMessageSize="200000000"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="200000000" maxArrayLength="200000000"
                        maxBytesPerRead="200000000" maxNameTableCharCount="200000000" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://igw020738:8731/WcfServiceLibraryForLoadPicture/Service1/"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
                contract="SilverlightApplicationLoadPicture.ServiceReference1.IService1"
                name="BasicHttpBinding_IService1" />
        </client>
    </system.serviceModel>
</configuration>


На WPF приложениях проверял сервис передает сообщения больше 65536 
Все делается для того что бы в SilverLight отобразить картинку с базы. 
Пишет вот такую ошибку 

An exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll but was not handled in user code

Additional information: [MaxReceivedMessageSizeExceeded]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=MaxReceivedMessageSizeExceeded


по ссылке ходил нечего интересного

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)