Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 找不到基址或最大字符串内容长度配额(8192)?_Asp.net_Wcf_Jquery - Fatal编程技术网

Asp.net 找不到基址或最大字符串内容长度配额(8192)?

Asp.net 找不到基址或最大字符串内容长度配额(8192)?,asp.net,wcf,jquery,Asp.net,Wcf,Jquery,读取XML数据时,超过了最大字符串内容长度配额(8192)。在ajax POST调用中 我在中添加了bindingConfiguration=“UsernameWithTransport”,并且在我获得后还添加了,无法找到与绑定WebHttpBinding的端点的方案https相匹配的基址。注册的基址方案是[http]异常 请参见下面我的web.config文件 <system.serviceModel> <behaviors> <serviceBehavior

读取XML数据时,
超过了最大字符串内容长度配额(8192)。
在ajax POST调用中

我在
中添加了
bindingConfiguration=“UsernameWithTransport”
,并且在我获得
后还添加了
,无法找到与绑定WebHttpBinding的端点的方案https相匹配的基址。注册的基址方案是[http]
异常

请参见下面我的web.config文件

<system.serviceModel>
<behaviors>
  <serviceBehaviors>   
      <behavior name="metadataBehavior">
          <serviceMetadata  httpGetEnabled="true" httpGetUrl="" httpsGetEnabled="false"/>            
          <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
      </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="Company.CostReduction.EditInitiativesAspNetAjaxBehavior">
      <enableWebScript />
    </behavior>
  </endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
  <service name="Company.CostReduction.EditInitiatives" behaviorConfiguration="metadataBehavior">
      <host>
          <baseAddresses>
              <add baseAddress="http://localhost:57771/EditInitiatives.svc" />
          </baseAddresses>
      </host>
      <endpoint address="" behaviorConfiguration="Company.CostReduction.EditInitiativesAspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="UsernameWithTransport" contract="Company.CostReduction.EditInitiatives"  />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<bindings>
  <webHttpBinding>
    <binding name="UsernameWithTransport">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="Transport">
        <transport clientCredentialType="Basic" />
      </security>
    </binding>
  </webHttpBinding>
</bindings>


这里出了什么问题?

问题从这里开始

  <host>
      <baseAddresses>
          <add baseAddress="http://localhost:57771/EditInitiatives.svc" />
      </baseAddresses>
  </host>
你要用交通安全来主持你的服务。Sou您需要将httpGetEnabled设置为false,将httpsGetEnabled设置为true。这是与当前配置相反的设置

最后,要承载具有传输安全性的元数据,您还需要在此处进行更改:

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

应改为:

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

尝试这些更改,并在此处发布更多错误

希望这有帮助

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />