我正在尝试在n层架构中跨层发送两个图像(80K字节)和少量数据。
我的项目有以下图层
web.config
app.config
:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<system.web>
<httpRuntime maxRequestLength="2147483647"/>
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpOrganizationService"
closeTimeout="00:05:00"
openTimeout="00:05:00"
receiveTimeout ="00:10:00"
sendTimeout="00:05:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2000000"
maxReceivedMessageSize="2147483647"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:24218/OrganizationService.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpOrganizationService"
contract="OrganizationServiceReference.IOrganizationService"
name="wsHttpOrganizationService">
<identity>
<userPrincipalName value="GOPALCHETTRI-PC\Gopal Chettri" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
UI.Process图层中的 App.config
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpOrganizationService"
closeTimeout="00:05:00"
openTimeout="00:05:00"
receiveTimeout ="00:10:00"
sendTimeout="00:05:00"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2000000"
maxReceivedMessageSize="2147483647"
useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:24218/OrganizationService.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpOrganizationService"
contract="OrganizationServiceReference.IOrganizationService"
name="wsHttpOrganizationService">
<identity>
<userPrincipalName value="GOPALCHETTRI-PC\Gopal Chettri" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
主机项目中的 web.config
<configuration>
<appSettings>
<add key="pageSize" value="10" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" />
</system.web>
<connectionStrings>
<add name="default" connectionString="Data Source=GopalChettri-PC\SQL2012;database=POCBCP;User ID=sa;Password=pass;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<serviceActivations>
<add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="./OrganizationService.svc" service="BCP.Services.OrganizationService" />
</serviceActivations>
</serviceHostingEnvironment>
<services>
<service name="BCP.Services.OrganizationService" behaviorConfiguration="DefaultServiceBehavior">
<endpoint name="wsHttpOrganizationService" address="" binding="wsHttpBinding" contract="BCP.Services.Contracts.IOrganizationService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings></bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<extensions>
<behaviorExtensions></behaviorExtensions>
</extensions>
</system.serviceModel>
</configuration>
我已经阅读了很多关于此错误的帖子,但没有任何帮助我解决问题。
请指导我正确的方向,以便我能解决这个问题。