简体   繁体   English

在IIS中发布Web服务时出错-找不到基础…绑定WebHttpBinding。 注册的基址方案为[https]

[英]Error publishing web service in IIS - Could not find a base… binding WebHttpBinding. Registered base address schemes are [https]

I'm trying to publish a webservice created and published in VS2015. 我正在尝试发布在VS2015中创建和发布的Web服务。 When I publish it in IIS, I have the following error: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. 当我在IIS中发布它时,出现以下错误: 找不到与绑定WebHttpBinding的端点的方案http匹配的基地址。 Registered base address schemes are [https] I saw a lot of posts about it, and I tried to change my IIS and my web.config with no success. 注册的基址方案是[https],我看到了很多关于它的文章,并且我尝试更改IIS和web.config都没有成功。

I have configured a https website in IIS with self-signed certificate. 我已经在IIS中使用自签名证书配置了https网站。 It works normally, but when I try to access the webservice, I got the error that I described above. 它正常工作,但是当我尝试访问Web服务时,出现了上面描述的错误。 If I use this webservice in http websites, it works with no problem. 如果我在http网站中使用此web服务,则可以正常使用。

My web.config 我的web.config

    <?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation targetFramework="4.6" />
    <httpRuntime targetFramework="4.6" />
    <customErrors mode="Off"/>  
  </system.web>
  <system.serviceModel>
    <!--CONFIGURAÇÃO DO SERVIÇO-->
    <services>      
      <service name="ServicoRest.ServiceGestorWMS">
        <endpoint address="../ServiceGestorWMS.svc" binding="webHttpBinding" contract="ServicoRest.IServiceGestorWMS" behaviorConfiguration="webBehaviour" />
        <endpoint address="mex"  
                  binding="mexHttpsBinding"  
                  contract="IMetadataExchange" />  
      </service>
    </services>
     <bindings>
   <webHttpBinding>
    <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
    <binding name="webHttpsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
  </webHttpBinding>
 </bindings>
    <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>
      <!--CONFIGURAÇÃO DO SERVIÇO-->
      <endpointBehaviors>
        <behavior name="webBehaviour">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <!--SE VOCÊ PRECISAR ACESSAR O SERVIÇO DE OUTRO DOMÍNIO VIA JAVASCRIPT VOCÊ DEVE INFORMAR O BLOCO DE CÓDIGO ABAIXO -->
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type, Accept" />
        <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
      </customHeaders>
    </httpProtocol>
    <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>
  <connectionStrings>
    <add name="" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=;initial catalog=;persist security info=True;user id=sa;password=;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>
</configuration>
<!--ProjectGuid: {D84BF523-87CA-4D7D-90AE-CEE789984582}-->

Murphy, 墨菲

You do not seem to have set the binding. 您似乎尚未设置绑定。 You would need something like the code below in your web.config if you want to support HTTP and HTTPS for the webHttpBinding: 如果要为webHttpBinding支持HTTP和HTTPS,则需要在web.config中使用以下代码:

<webHttpBinding>
    <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
    <binding name="webHttpsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
  </webHttpBinding>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到与绑定WSHttpBinding的端点的方案https匹配的基地址。 注册的基址方案为[http]。 - Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http]. 找不到与绑定WebHttpBinding的端点匹配方案https的基地址 - Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding 从 http 到 https,得到“找不到与具有绑定 WebHttpBinding 的端点的方案 http 匹配的基地址” - Going from http to https, getting "Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding" 找不到与绑定BasicHttpBinding的端点的方案https匹配的基址 - Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding 找不到与方案https匹配的基地址 - Could not find a base address that matches scheme https 找不到与绑定BasicHttpBinding的端点匹配方案http的基地址 - Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding 部署Web服务时出错。 找不到与绑定BasicHttpBinding的端点匹配方案http的基地址 - Error while deploying webservice. Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding WCF错误。 找不到与绑定WSHttpBinding的端点的方案http匹配的基地址 - Error with WCF. Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding 发布一个简单的.NET Web服务会产生IIS“使用注册为allowDefinition =&#39;MachineToApplication&#39;的部分是错误的……” - Publishing a simple .NET web service yields IIS “It is an error to use a section registered as allowDefinition='MachineToApplication' …” 在IIS 7上发布Web服务给出500.19-内部服务器错误 - Publishing web service on IIS 7 gives 500.19 - Internal Server Error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM