arman_Delta2002
پنج شنبه 16 اردیبهشت 1395, 10:14 صبح
سلام یه مشکل جدید تو ای ای اس اکسپرس خوردم اونم اینه که با این که در تنظیمات کانفیگ فایل کلاینت ام رو ست کردم ولی در زمان اجرا خطا میده که از مقدار پیش فرض استفاده شده
کانفیگ کلاینت
<?xmlversion="1.0"encoding="utf-8"?>
<configuration>
<system.serviceModel>
<behaviors />
<bindings>
<basicHttpBinding>
<bindingname="End11"closeTimeout="01:01:00"openTimeout="01:01:00"
receiveTimeout="01:10:00"sendTimeout="01:01:00"maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"maxReceivedMessageSize="2147483647">
<readerQuotasmaxDepth="2147483647"maxStringContentLength="2147483647"
maxArrayLength="2147483647"maxBytesPerRead="2147483647"maxNameTableCharCount="2147483647" />
<securitymode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpointaddress="http://localhost:1735/Service1.svc"binding="basicHttpBinding"
bindingConfiguration="End11"contract="IService1"name="End11" />
</client>
</system.serviceModel>
</configuration>
کانفیگ سرور
<?xmlversion="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<sourcepropagateActivity="true"name="System.ServiceModel"switchValue="Warning,ActivityTracing">
<listeners>
<addtype="System.Diagnostics.DefaultTraceListener"name="Default">
<filtertype="" />
</add>
<addname="ServiceModelTraceListener">
<filtertype="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<addinitializeData="e:\triples\triples\server\tripleswcfservice1\web_t racelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener"traceOutputOptions="Timestamp">
</add>
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<bindingname="BasicHttpBinding_IService1"closeTimeout="01:00:00"
openTimeout="01:00:00"receiveTimeout="01:00:00"sendTimeout="01:00:00"
allowCookies="true"bypassProxyOnLocal="false"hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647"maxBufferSize="2147483647"maxReceivedMessageSize="2147483647"
textEncoding="utf-8"transferMode="Buffered"useDefaultWebProxy="false"
messageEncoding="Text">
<readerQuotasmaxDepth="2147483647"maxStringContentLength="2147483647"
maxArrayLength="2147483647"maxBytesPerRead="2147483647"maxNameTableCharCount="2147483647" />
<securitymode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<servicename="TripleSWcfService1.Service1">
<endpointaddress=""binding="basicHttpBinding"bindingConfiguration=""
name="End11"contract="TripleSWcfService1.IService1"isSystemEndpoint="false" />
<host>
<timeoutscloseTimeout="01:00:10"openTimeout="01:01:00" />
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behaviorname="">
<serviceMetadatahttpGetEnabled="true"httpsGetEnabled="true"/>
<serviceDebugincludeExceptionDetailInFaults="false"/>
<serviceTimeoutstransactionTimeout="01:00:01"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<addbinding="basicHttpsBinding"scheme="http"/>
</protocolMapping>
<serviceHostingEnvironmentaspNetCompatibilityEnable d="false"multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.web>
<httpRuntimetargetFramework="4.5"useFullyQualifiedRedirectUrl="true"maxRequestLength="2147483647"requestLengthDiskThreshold="2147483647"executionTimeout="18000" />
<compilationdebug="true"targetFramework="4.6"/>
<customErrorsmode="Off"/>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimitsmaxAllowedContentLength="2147483647"></requestLimits>
</requestFiltering>
</security>
<modulesrunAllManagedModulesForAllRequests="true"/>
<directoryBrowseenabled="true"/>
</system.webServer>
<system.web.extensions>
<scripting>
<webServices>
<authenticationServiceenabled="true"requireSSL="false"/>
</webServices>
</scripting>
</system.web.extensions>
</configuration>
این خطا رو میده
The remote server returned an error: (400) Bad Request.
maxReceivedMessageSize رو ست کردم ولی باز خطا بالا رو میده و رفتم چک کردم میبینم عددی که من ست کردم نیست و مقدار پیشفرض هست که یه عدد کوچیکتره .
یک کلاس میفرستم یک تصویر هم ارسال میشه به سرور و اطاعات ذخیره میشه
جالب اینجاست که زمان برگردوندن پاسخ از سمت سرور همون کلاس با مقدار ID هم ست کردم رو بگیرم خطا میده
و اطاعات ثبت شده در پایگاه داده .
زمانی که تصویر ارسالی خیلی خیلی کوچیک باشه مشکلی نداره و خطا نمیده ولی اگه یه تصویر 12 کیلو بایتی هم باشه خطا میده !
140255
چاره چیه ؟
کانفیگ کلاینت
<?xmlversion="1.0"encoding="utf-8"?>
<configuration>
<system.serviceModel>
<behaviors />
<bindings>
<basicHttpBinding>
<bindingname="End11"closeTimeout="01:01:00"openTimeout="01:01:00"
receiveTimeout="01:10:00"sendTimeout="01:01:00"maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"maxReceivedMessageSize="2147483647">
<readerQuotasmaxDepth="2147483647"maxStringContentLength="2147483647"
maxArrayLength="2147483647"maxBytesPerRead="2147483647"maxNameTableCharCount="2147483647" />
<securitymode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpointaddress="http://localhost:1735/Service1.svc"binding="basicHttpBinding"
bindingConfiguration="End11"contract="IService1"name="End11" />
</client>
</system.serviceModel>
</configuration>
کانفیگ سرور
<?xmlversion="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<sourcepropagateActivity="true"name="System.ServiceModel"switchValue="Warning,ActivityTracing">
<listeners>
<addtype="System.Diagnostics.DefaultTraceListener"name="Default">
<filtertype="" />
</add>
<addname="ServiceModelTraceListener">
<filtertype="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<addinitializeData="e:\triples\triples\server\tripleswcfservice1\web_t racelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener"traceOutputOptions="Timestamp">
</add>
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<bindingname="BasicHttpBinding_IService1"closeTimeout="01:00:00"
openTimeout="01:00:00"receiveTimeout="01:00:00"sendTimeout="01:00:00"
allowCookies="true"bypassProxyOnLocal="false"hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647"maxBufferSize="2147483647"maxReceivedMessageSize="2147483647"
textEncoding="utf-8"transferMode="Buffered"useDefaultWebProxy="false"
messageEncoding="Text">
<readerQuotasmaxDepth="2147483647"maxStringContentLength="2147483647"
maxArrayLength="2147483647"maxBytesPerRead="2147483647"maxNameTableCharCount="2147483647" />
<securitymode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<servicename="TripleSWcfService1.Service1">
<endpointaddress=""binding="basicHttpBinding"bindingConfiguration=""
name="End11"contract="TripleSWcfService1.IService1"isSystemEndpoint="false" />
<host>
<timeoutscloseTimeout="01:00:10"openTimeout="01:01:00" />
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behaviorname="">
<serviceMetadatahttpGetEnabled="true"httpsGetEnabled="true"/>
<serviceDebugincludeExceptionDetailInFaults="false"/>
<serviceTimeoutstransactionTimeout="01:00:01"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<addbinding="basicHttpsBinding"scheme="http"/>
</protocolMapping>
<serviceHostingEnvironmentaspNetCompatibilityEnable d="false"multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.web>
<httpRuntimetargetFramework="4.5"useFullyQualifiedRedirectUrl="true"maxRequestLength="2147483647"requestLengthDiskThreshold="2147483647"executionTimeout="18000" />
<compilationdebug="true"targetFramework="4.6"/>
<customErrorsmode="Off"/>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimitsmaxAllowedContentLength="2147483647"></requestLimits>
</requestFiltering>
</security>
<modulesrunAllManagedModulesForAllRequests="true"/>
<directoryBrowseenabled="true"/>
</system.webServer>
<system.web.extensions>
<scripting>
<webServices>
<authenticationServiceenabled="true"requireSSL="false"/>
</webServices>
</scripting>
</system.web.extensions>
</configuration>
این خطا رو میده
The remote server returned an error: (400) Bad Request.
maxReceivedMessageSize رو ست کردم ولی باز خطا بالا رو میده و رفتم چک کردم میبینم عددی که من ست کردم نیست و مقدار پیشفرض هست که یه عدد کوچیکتره .
یک کلاس میفرستم یک تصویر هم ارسال میشه به سرور و اطاعات ذخیره میشه
جالب اینجاست که زمان برگردوندن پاسخ از سمت سرور همون کلاس با مقدار ID هم ست کردم رو بگیرم خطا میده
و اطاعات ثبت شده در پایگاه داده .
زمانی که تصویر ارسالی خیلی خیلی کوچیک باشه مشکلی نداره و خطا نمیده ولی اگه یه تصویر 12 کیلو بایتی هم باشه خطا میده !
140255
چاره چیه ؟