我发现此错误" T * 已超出传入邮件的最大邮件大小限额(65536) *" 我最大化了maxReceivedMessageSize,但没有什么进展顺利 app.config是服务层:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<!-- Lors du déploiement du projet de bibilothèque de services, le contenu du fichier de configuration doit être ajouté au fichier app.config
de l'hôte. System.Configuration ne prend pas en charge les fichiers de configuration des bibliothèques. -->
<system.serviceModel>
<services>
<service name="Navigateur.SL.ParentService">
<endpoint address="" binding="basicHttpBinding" contract="Navigateur.SL.IParentService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/Navigateur.SL/Service1/" />
</baseAddresses>
</host>
</service>
<service name="Navigateur.SL.VideoService">
<endpoint address="" binding="basicHttpBinding" contract="Navigateur.SL.IVideoService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/Navigateur.SL/Service2/" />
</baseAddresses>
</host>
</service>
<service name="Navigateur.SL.EnfantService">
<endpoint address="" binding="basicHttpBinding" contract="Navigateur.SL.IEnfantService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/Navigateur.SL/Service3/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- Pour éviter la divulgation d'informations de métadonnées,
définissez les valeurs ci-dessous sur false avant le déploiement -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
<!-- Pour recevoir les détails de l'exception dans les erreurs à des fins de débogage,
définissez la valeur ci-dessous sur true. Pour éviter la divulgation d'informations d'exception,
définissez-la sur false avant le déploiement -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<connectionStrings>
<add name="FamissimaEntities" connectionString="metadata=res://*/NavigateurModel.csdl|res://*/NavigateurModel.ssdl|res://*/NavigateurModel.msl;provider=System.Data.SqlClient;provider connection string="data source=HP\SQLEXPRESS;initial catalog=Famissima;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
表示层中的app.config是:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IParentService" maxReceivedMessageSize="1000000" />
<binding name="BasicHttpBinding_IVideoService" maxReceivedMessageSize="1000000"/>
<binding name="BasicHttpBinding_IEnfantService" maxReceivedMessageSize="1000000"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8733/Design_Time_Addresses/Navigateur.SL/Service1/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IParentService"
contract="ServiceReferenceParent.IParentService" name="BasicHttpBinding_IParentService" />
<endpoint address="http://localhost:8733/Design_Time_Addresses/Navigateur.SL/Service2/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IVideoService"
contract="ServiceReferenceVideo.IVideoService" name="BasicHttpBinding_IVideoService" />
<endpoint address="http://localhost:8733/Design_Time_Addresses/Navigateur.SL/Service3/"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEnfantService"
contract="ServiceReferenceEnfant.IEnfantService" name="BasicHttpBinding_IEnfantService" />
</client>
</system.serviceModel>
</configuration>
有人可以帮帮我!!!
答案 0 :(得分:0)
为了处理大型数据,你应该有一个ServiceBehavior并将maxItemsInObjectGraph设置如下
<endpointBehaviors>
<behavior name="SilverlightWCFLargeDataApplication">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehavior>