2015-11-18 107 views
0

我得到一遍又一遍的相同的錯誤。爲什麼綁定元素沒有綁定到我的服務?

這是我的web.config代碼:

<?xml version="1.0"?> 
<configuration> 
    <appSettings> 
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/> 
    <add key="api_url" value="http://182.73.171.198/"/> 
    </appSettings> 
    <!--For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367. The following attributes be can set on the <httpRuntime> tag. 
     <system.Web> 
     <httpRuntime targetFramework="4.5" /> 
     </system.Web> 
    --> 
    <system.web> 
    <compilation debug="true" targetFramework="4.5"> 
     <assemblies> 
     <add assembly="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     </assemblies> 
    </compilation> 
    <httpRuntime targetFramework="4.5.1"/> 
    </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> 

    <bindings> 
     <basicHttpBinding> 
     <binding name="basicHttp" allowCookies="true" 
       maxReceivedMessageSize="20000000" 
       maxBufferSize="20000000" 
       maxBufferPoolSize="20000000"> 
      <readerQuotas maxDepth="32" 
       maxArrayLength="200000000" 
       maxStringContentLength="200000000"/> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 

    <services> 
     <service name="Netlockapi.INetlockapi"> 
     <endpoint binding="basicHttpBinding" bindingConfiguration="" bindingName="basicHttp" contract="Netlockapi.INetlockapi" /> 
     </service> 
    </services> 

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> 
    </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>  

我厭倦了試圖讓綁定到綁定元素的NetlockApi。我總是得到與maxReceivedMessageSize超出相同的錯誤。請幫忙。

回答

0
<bindings> 
    <basicHttpBinding> 
     <binding name="basicHttp" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2097152" maxBufferPoolSize="524288" maxReceivedMessageSize="2097152" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="2097152" maxArrayLength="2097152" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> 
       <security mode="None"> 
        <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
        <message clientCredentialType="UserName" algorithmSuite="Default"/> 
       </security> 
     </binding> 
    </basicHttpBinding> 
</bindings> 
+0

仍然收到相同的錯誤。你能否提出一些可能出錯的建議? –

相關問題