Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > บันทึกรูปใน sql server โดยผ่าน WCF Service ไม่ได้ C# - the remote server returned an unexpected response (413) request entity too large



 

บันทึกรูปใน sql server โดยผ่าน WCF Service ไม่ได้ C# - the remote server returned an unexpected response (413) request entity too large

 



Topic : 115531



โพสกระทู้ ( 35 )
บทความ ( 0 )



สถานะออฟไลน์




คือมัน error แบบนี้ครับ

Error
the remote server returned an unexpected response (413) request entity too large


ด

มันบอกว่า file ใหญ่เกีนไป แต่รูบมีแค่ 55.5 KB เองครับ
หาวิธีแก้ในเน็ด 2 วันแล้ว ทำตามเขาก็ไม่ได้ เขาบอกไปแก้ที่ Web.config แก้ตามเขา แต่ก็ไม่ได้ ช่วยแนะนำด้วยครับ

file Web.config อยู่ฝั่ง Service

Code (XML)
<?xml version="1.0"?>
<configuration>
  <system.diagnostics>
    <sources>
      <source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelTraceListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="d:\sharesourcehospital\hospital4\hospitalserver\web_tracelog.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>
  <connectionStrings>
    <add name="sqlconnect"
        connectionString="Data Source=GM-VATH\SQLEXPRESS;Initial Catalog=Hospital;User ID=sa;Password=12345"
        providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>

    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime maxRequestLength="2097151000" targetFramework="4.5"/>
  </system.web>


  
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    
    <!-- custom insert -->
    <bindings>
      <basicHttpBinding>
        <binding name="wsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8"
     transferMode="Streamed">
        <!--<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />-->
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
          maxArrayLength="2147483647" maxBytesPerRead="2147483647"
          maxNameTableCharCount="2147483647"/>
         <security mode="None">
      <transport clientCredentialType="None" 
              proxyCredentialType="None" realm="" />
      <message clientCredentialType="UserName" algorithmSuite="Default" />
  </security>
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
   
  </system.webServer>

</configuration>




App.config ฝั่ง Client ครับ
Code (XML)
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
    </configSections>
    <system.diagnostics>
        <sources>
            <source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing">
                <listeners>
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                        <filter type="" />
                    </add>
                    <add name="ServiceModelTraceListener">
                        <filter type="" />
                    </add>
                </listeners>
            </source>
        </sources>
        <sharedListeners>
            <add initializeData="d:\sharesourcehospital\hospital4\hospital\app_tracelog.svclog"
                type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
                <filter type="" />
            </add>
        </sharedListeners>
    </system.diagnostics>
    <connectionStrings>
        <add name="sqlconnect"
            connectionString="Data Source=GM-VATH\SQLEXPRESS;Initial Catalog=Hospital;User ID=sa;Password=12345"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime  sku=".NETFramework,Version=v4.0" version="v4.0"/>
  </startup>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IHospitalService" closeTimeout="00:11:00"
          openTimeout="00:11:00" receiveTimeout="00:11:00" sendTimeout="00:11:00"
          maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
        <binding name="BasicHttpBinding_IHospitalService1" closeTimeout="00:11:00"
          openTimeout="00:11:00" receiveTimeout="00:11:00" sendTimeout="00:11:00"
          maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
        <binding name="BasicHttpBinding_IService1" closeTimeout="00:11:00"
          openTimeout="00:11:00" sendTimeout="00:11:00" maxBufferPoolSize="2147483647"
          maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
        <binding name="BasicHttpBinding_IService11" closeTimeout="00:11:00"
          openTimeout="00:11:00" sendTimeout="00:11:00" maxBufferPoolSize="2147483647"
          maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
      </basicHttpBinding>
    </bindings>
    <client>
      <!--http://localhost:9682/HospitalService.svc -->
      <endpoint address="http://localhost:9682/HospitalService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IHospitalService"
        contract="HosService.IHospitalService" name="BasicHttpBinding_IHospitalService" />
      <endpoint address="http://localhost:9682/Service1.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService1" contract="ActionService1.IService1"
        name="BasicHttpBinding_IService1" />
      <endpoint address="http://localhost:9682/Service1.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_IService11" contract="ActionService.IService1"
        name="BasicHttpBinding_IService11" />
    </client>
  </system.serviceModel>
</configuration>




Tag : .NET, Ms SQL Server 2012, C#







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-03-31 14:01:55 By : hacker2015 View : 1998 Reply : 10
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ถ้าไฟล์เล็ก ๆ ได้หรือเปล่าครับ เช่นซะ 2-4 K ประมาณนี้ครับ ถ้าได้แสดงว่าน่าจะต้องไปหา Config พวก Size อะไรซะอย่างที่เกี่ยวข้องครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-01 07:39:35 By : mr.win
 


 

No. 2



โพสกระทู้ ( 35 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 1 เขียนโดย : mr.win เมื่อวันที่ 2015-04-01 07:39:35
รายละเอียดของการตอบ ::
file เล็ก บันทึกได้ครับ
หาทางแก้วันนี้ วันที่สามแล้ว ยังไม่ได้เลย

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-01 11:33:53 By : hacker2015
 

 

No. 3



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code
<system.serviceModel> <services> <service name="RGB2LEDWebService.RGB2LED"> <endpoint name="http" binding="basicHttpBinding" contract="RGB2LEDWebService.IRGB2LED" /> </service> </services> <bindings> <basicHttpBinding> <binding maxReceivedMessageSize="2147483647" /> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </endpointBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https" /> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel>

เท่าที่หาดูก็มีประมาณนี้แหละครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-01 12:56:34 By : mr.win
 


 

No. 4



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

อีกตัวอย่าง

Code
<bindings> <basicHttpBinding> <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"> <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding> </bindings>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-01 13:03:57 By : mr.win
 


 

No. 5



โพสกระทู้ ( 35 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณครับ ที่แนะนำ ผมแก้ตามแล้ว แต่ยังไม่ได้ เดี๋ยวผมจะค้นหาต่อไป หวังว่าสักวันมันต้องได้
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-01 14:12:16 By : hacker2015
 


 

No. 6



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ลองดูครับ ถ้าได้ยังไงรบกวนกลับมาบอกวิธีด้วยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-02 09:41:12 By : mr.win
 


 

No. 7



โพสกระทู้ ( 35 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วครับ
5 วันเต็มๆ

ถ้าใคร Error แบบเดียวกันกับผมก็ลองเอาไปปรับดูครับ

SERVICE SIDE
<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Service.AdMapServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="Service.AdMapServiceBehavior"
        name="Service.AdMapService">
        <endpoint address="" binding="wsHttpBinding" contract="Service.IAdMapService" name="wsHttp" bindingConfiguration="wsHttpBindingConfiguration">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    
    <bindings>
      <wsHttpBinding>  
        <binding name="wsHttpBindingConfiguration" maxReceivedMessageSize="65536000" messageEncoding="Text" maxBufferPoolSize="65536000">
          <readerQuotas maxArrayLength="65536000" maxBytesPerRead="65536000" maxDepth="65536000" maxStringContentLength="2048576" maxNameTableCharCount="2048576" ></readerQuotas>
        </binding>        
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>



CLIENT SIDE
<system.serviceModel>
        <bindings>
   <wsHttpBinding>
    <binding name="wsHttpBindingConfiguration" closeTimeout="00:01:00" openTimeout="00:01:00"
     receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
     transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     maxBufferPoolSize="65536000" maxReceivedMessageSize="65536000" messageEncoding="Text"
     textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
     <readerQuotas maxDepth="65536000" maxStringContentLength="65536000" maxArrayLength="65536000"
      maxBytesPerRead="65536000" maxNameTableCharCount="65536000" />
     <reliableSession ordered="true" inactivityTimeout="00:10:00"
      enabled="false"/>
      <!--<security mode="Message">
      <transport clientCredentialType="Windows" proxyCredentialType="None"
       realm="" />
      <message clientCredentialType="Windows" negotiateServiceCredential="true"
       algorithmSuite="Default" />
     </security>-->
    </binding>
   </wsHttpBinding>
  </bindings>
        <client>
   <endpoint address="http://localhost:7352/AdMapService.svc" binding="wsHttpBinding"
    contract="AdMapServiceReference.IAdMapService"
    name="wsHttp" behaviorConfiguration="WSHttpBinding_IAdMapService" bindingConfiguration="wsHttpBindingConfiguration">
    <identity>
     <dns value="localhost" />
    </identity>
   </endpoint>
  </client>

    <behaviors>
      <endpointBehaviors>
        <behavior name="WSHttpBinding_IAdMapService">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    </system.serviceModel>



ประวัติการแก้ไข
2015-04-03 11:49:18
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-03 11:47:48 By : keooudone
 


 

No. 8



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ประเด็นหลักมันอยู่ที่ Set ค่าอะไรครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-03 11:56:36 By : mr.win
 


 

No. 9



โพสกระทู้ ( 35 )
บทความ ( 0 )



สถานะออฟไลน์


ผมไม่แน่ใจครับ
เพาะแก้จาก code เดีมผมหลายแถวมาก ผม copy ของเขา มาทับของเดีม แล้วเปลี่ยน endpoint ให้ใช้งานกับ WCF Service ผม
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-03 13:28:57 By : keooudone
 


 

No. 10



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-03 13:40:49 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : บันทึกรูปใน sql server โดยผ่าน WCF Service ไม่ได้ C# - the remote server returned an unexpected response (413) request entity too large
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่