部署网络服务时出错。找不到与具有绑定 BasicHttpBinding 的终结点的方案 http 匹配的基址
Error while deploying webservice. Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding
我一直在尝试在生产 IIS 服务器中的 .NET 3.5 中部署一个简单的同步服务(使用 VS2008 的 WCF 服务库实现)。在部署和测试它时,它抛出了以下错误:
"Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]."
这是 web.config
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://194.165.0.8:80/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration">
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MobileSyncServiceLibrary.AdventureWorksSyncService" behaviorConfiguration="MobileSyncServiceLibrary.AdventureWorksSyncServiceBehavior">
<endpoint address="http://194.165.0.8:80/PruebaWS/MobileSyncServiceLibrary.AdventureWorksSyncService.svc" binding="basicHttpBinding" contract="MobileSyncServiceLibrary.IAdventureWorksSyncContract" bindingConfiguration="basicHttpBindingConfiguration"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MobileSyncServiceLibrary.AdventureWorksSyncServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<defaultDocument>
<files>
<remove value="Default.htm" />
<remove value="Default.asp" />
<remove value="index.htm" />
<remove value="index.html" />
<remove value="iisstart.htm" />
<remove value="default.aspx" />
<add value="MobileSyncServiceLibrary.AdventureWorksSyncService.svc" />
</files>
</defaultDocument>
</system.webServer>
关于这个问题,我已经完成了大多数帖子中指出的解决方案:
设置安全模式=None
设置 httpsGetEnabled="false"
我看到的所有答案都指向这两个设置,但我无法修复配置上的错误。
关于我缺少什么或我需要更改什么的任何想法?这是服务抛出的当前异常。
[ServiceActivationException: The service '/PruebaWS/MobileSyncServiceLibrary.AdventureWorksSyncService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]..]
System.Runtime.AsyncResult.End(IAsyncResult result) +594083
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +238
System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +327
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92
这是网站上的当前绑定。
好的。找到了解决方案。我看错了多重绑定解决方案。
我阅读了以下部分,告诉网站我将服务指向哪个绑定。
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://194.165.0.8:80/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
根据这个答案正好相反。
问题是我造成的,服务被重定向到 https 绑定
所以我将前缀更改为https://194.165.0.8:443以过滤掉https并将其发送到http连接。
我一直在尝试在生产 IIS 服务器中的 .NET 3.5 中部署一个简单的同步服务(使用 VS2008 的 WCF 服务库实现)。在部署和测试它时,它抛出了以下错误:
"Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]."
这是 web.config
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://194.165.0.8:80/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration">
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MobileSyncServiceLibrary.AdventureWorksSyncService" behaviorConfiguration="MobileSyncServiceLibrary.AdventureWorksSyncServiceBehavior">
<endpoint address="http://194.165.0.8:80/PruebaWS/MobileSyncServiceLibrary.AdventureWorksSyncService.svc" binding="basicHttpBinding" contract="MobileSyncServiceLibrary.IAdventureWorksSyncContract" bindingConfiguration="basicHttpBindingConfiguration"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MobileSyncServiceLibrary.AdventureWorksSyncServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<defaultDocument>
<files>
<remove value="Default.htm" />
<remove value="Default.asp" />
<remove value="index.htm" />
<remove value="index.html" />
<remove value="iisstart.htm" />
<remove value="default.aspx" />
<add value="MobileSyncServiceLibrary.AdventureWorksSyncService.svc" />
</files>
</defaultDocument>
</system.webServer>
关于这个问题,我已经完成了大多数帖子中指出的解决方案:
设置安全模式=None
设置 httpsGetEnabled="false"
我看到的所有答案都指向这两个设置,但我无法修复配置上的错误。
关于我缺少什么或我需要更改什么的任何想法?这是服务抛出的当前异常。
[ServiceActivationException: The service '/PruebaWS/MobileSyncServiceLibrary.AdventureWorksSyncService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https]..] System.Runtime.AsyncResult.End(IAsyncResult result) +594083 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +238 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +327 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92
这是网站上的当前绑定。
好的。找到了解决方案。我看错了多重绑定解决方案。
我阅读了以下部分,告诉网站我将服务指向哪个绑定。
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://194.165.0.8:80/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
根据这个答案正好相反。
问题是我造成的,服务被重定向到 https 绑定
所以我将前缀更改为https://194.165.0.8:443以过滤掉https并将其发送到http连接。