PDA

View Full Version : سوال: خطا وقتی که دومین تابع وب سرویس فراخانی میشود.



arman_Delta2002
یک شنبه 30 فروردین 1394, 17:59 عصر
سلام باز مشکل با وب سرویس لعنتی


An unhandled exception of type 'System.ServiceModel.ProtocolException' occurred in mscorlib.dll

Additional information: The remote server returned an unexpected response: (413) Request Entity Too Large.

یک تابع برای ورود از وب سرویس فرا خوانده میشه و بعد تابع بعدی که خوانده میشه این خطا بالا رو میده واسه چی اخه !!!!
app سمت کلاینت

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="End11" closeTimeout="01:01:00" openTimeout="01:01:00"
receiveTimeout="01:10:00" sendTimeout="01:01:00" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession inactivityTimeout="01:10:00" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:1735/Service1.svc" binding="wsDualHttpBinding"
bindingConfiguration="End11" contract="ServiceReference1.IService1"
name="End11">
<identity>
<userPrincipalName value="arman-laptop\arman" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>


app سرویس

<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="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="Streamed" useDefaultWebProxy="false" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="Transport"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="TripleSWcfService1.Service1">
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration=""
name="End11" contract="TripleSWcfService1.IService1" isSystemEndpoint="false" />
<host>
<timeouts closeTimeout="01:00:10" openTimeout="01:01:00" />
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceTimeouts transactionTimeout="01:00:01"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

arman_Delta2002
یک شنبه 30 فروردین 1394, 20:33 عصر
تا اینجا متوجه شدم که چون در یک کلاس ام یک فیلد byte[] (ارایه بایت برای ذخیره تصویر) دارم نمیتونه اون کلاس رو ارسال کنه به سرور و خطا میده نمیشه با دستکاری کانفیگ کاری کرد که داده های هجیم تر به سرور ارسال بشه ؟

m.fazlali
دوشنبه 31 فروردین 1394, 16:44 عصر
تنظیمات binding سمت سرویس برای basicHttpBinding انجام شده نه برای wsDualHttpBinding و مقدار bindingConfiguration نیز خالی میباشد در صورتی که binding سمت کلاینت wsDualHttpBinding میباشد که در سمت سرور هیچگونه تنظیماتی برای آن وجود ندارد ! و با تنظیمات پیش فرض wcf در سمت سرور با wsDualHttpBinding متصل میشوید این یعنی اینکه شما هیچگونه تنظیماتی انجام نداده اید !