Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
将HTTP和HTTPS绑定添加到WCF Web服务_Wcf_Configuration - Fatal编程技术网

将HTTP和HTTPS绑定添加到WCF Web服务

将HTTP和HTTPS绑定添加到WCF Web服务,wcf,configuration,Wcf,Configuration,我有一个WCF Werbservice,我想通过HTTP和HTTPS与他联系 这是我真正的尝试。但我无法再使用http和https访问该服务:(请帮忙 首先,您有两个地址为空的终结点和两个地址为mex的终结点,但这些终结点没有相同的绑定。您必须为这些终结点定义不同的地址。对于安全绑定,请仅指定传输模式,除非您要对用户进行身份验证。对于服务元数据,请替换两次出现的serviceMetad包含两个属性的单个元素的ata 为什么要使用10小时超时?首先,您有两个地址为空的终结点和两个地址为mex的终结

我有一个WCF Werbservice,我想通过HTTP和HTTPS与他联系

这是我真正的尝试。但我无法再使用http和https访问该服务:(请帮忙


首先,您有两个地址为空的终结点和两个地址为mex的终结点,但这些终结点没有相同的绑定。您必须为这些终结点定义不同的地址。对于安全绑定,请仅指定传输模式,除非您要对用户进行身份验证。对于服务元数据,请替换两次出现的serviceMetad包含两个属性的单个元素的ata


为什么要使用10小时超时?

首先,您有两个地址为空的终结点和两个地址为mex的终结点,但这些终结点没有相同的绑定。您必须为这些终结点定义不同的地址。对于安全绑定,请仅指定传输模式,除非您要对用户进行身份验证。对于服务元数据,请重新执行ce出现两次serviceMetadata,单个元素同时包含两个属性


为什么要使用10小时超时?

好的,谢谢。但是你怎么说mex和其他端点没有相同的绑定?应该是这样吗?不,你需要为每个端点创建唯一的地址。不要更改绑定类型。好的,谢谢。但是你怎么说mex和其他端点没有相同的绑定绑定?应该是这样吗?不,您需要为每个端点创建唯一的地址。不要更改绑定类型。
<system.serviceModel>
  <bindings>
   <basicHttpBinding>
    <binding name="DefaultBinding" closeTimeout="10:01:00" openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00"
        transferMode="Streamed"
        maxBufferSize="104857600" maxBufferPoolSize="524288000" maxReceivedMessageSize="104857600">
     <readerQuotas
        maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647" />
     <security mode="None">
     </security>
    </binding>
    <binding name="SSLBinding">
     <security mode="TransportWithMessageCredential">
      <transport clientCredentialType="None"/>
     </security>
    </binding>
   </basicHttpBinding>
  </bindings>
  <services>
   <service behaviorConfiguration="DnsService.DNSSerivceBehavior" name="DnsService.DNSSerivce">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="DefaultBinding"  contract="DnsService.IDNSService">
     <identity>
      <dns value="localhost"/>
     </identity>
    </endpoint>
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SSLBinding"  contract="DnsService.IDNSService">
     <identity>
      <dns value="localhost"/>
     </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
   </service>
  </services>
  <behaviors>
   <serviceBehaviors>
    <behavior name="DnsService.DNSSerivceBehavior">
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
     <serviceMetadata httpGetEnabled="true"/>
     <serviceMetadata 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="true"/>
    </behavior>
   </serviceBehaviors>
  </behaviors>
 </system.serviceModel>