找不到与绑定BasicHttpBinding的端点匹配方案http的基地址.注册的基址方案为[]. [英] Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are []..

查看:57
本文介绍了找不到与绑定BasicHttpBinding的端点匹配方案http的基地址.注册的基址方案为[].的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Windows Azure SDK,特别是包含许多实验的Azure Services Kit.我遇到了WCF问题.我收到错误:

"所请求的服务 http://localhost:81/MessageLogger.svc/ System.ServiceModel.ServiceHostingEnvironment + HostingManager/36963566
例外:系统.ServiceModel.ServiceActivationException:由于编译期间发生异常,因此无法激活服务"/MessageLogger.svc".异常消息是:找不到与绑定BasicHttpBinding的端点的方案http匹配的基地址.注册的基址方案是[]. System.InvalidOperationException:找不到与绑定BasicHttpBinding的端点匹配方案http的基地址.注册的基址方案为[].

我的 App.config 是:

I have been working with the Windows Azure SDK, specifically the Azure Services Kit which contains many labs.  I am running into an issue with WCF.  I am receiving the error:

"The requested service http://localhost:81/MessageLogger.svc/ could not be activated. "

MessengerService is a WCF logging service running in the Developer Fabric on port 81, I created a console application to test with; sending messages from the console application to the service results in the error message below in the system event log.

System.ServiceModel.ServiceHostingEnvironment+HostingManager/36963566
Exception: System.ServiceModel.ServiceActivationException: The service '/MessageLogger.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 [].. ---> System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [].

My App.config is:

< system.serviceModel>
<绑定>
< basicHttpBinding>
closeTimeout ="00:01:00"
; openTimeout ="00:01:00"; receiveTimeout ="00:10:00" sendTimeout ="00:01:00"
. BypassProxyOnLocal ="false"; hostNameComparisonMode ="StrongWildcard"
; maxBufferSize ="65536"; maxBufferPoolSize ="524288" maxReceivedMessageSize ="65536"
textEncoding ="utf-8"; transferMode =缓冲的" useDefaultWebProxy ="true"..maxBytesPerRead ="4096". maxNameTableCharCount ="16384"; /<
<安全模式=无"<
< transport clientCredentialType ="None"<< transport clientCredentialType =" None" proxyCredentialType =无"
领域="realm =" />
消息< message clientCredentialType =" UserName" ;; algorithmSuite =默认" />

</security<
" http://localhost:81/MessageLogger.svc "
bindingConfiguration ="BasicHttpBinding_IMessageLogger"
contract ="RDService.IMessageLogger"; name ="BasicHttpBinding_IMessageLogger" />
</client>
</system.serviceModel>

----------------------------------------- -------------------------------------------------- ----------------------------------------

我的 WebConfig 是:

< system.serviceModel>
<行为>
< serviceBehaviors< service>< Message< Behavior<< Web®< Behavior<< Web®> Loghavior< Web"行为名称br>.< serviceMetadata httpGetEnabled ="true"; />
.< serviceDebug includeExceptionDetailInFaults ="false"; </&behaviour></&behavior></&behavior”</behavior></&behavior”</behavior></&behavior” >名称="RDCompute_WebRole.MessageLogger"<>< endpoint address =" binding ="basicHttpBinding"合同="RDCompute_WebRole.IMessageLogger"<身份<身份<身份< dns值=本地主机" /</
</identity>
</endpoint>
binding ="mexHttpBinding" contract ="IMetadataExchange" />
</service<</services</services</</services>
< serviceHostingEnvironment>
< baseAddressPrefixFilters" < http://localhost:5100/>
p>

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IMessageLogger" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:81/MessageLogger.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMessageLogger"
                contract="RDService.IMessageLogger" name="BasicHttpBinding_IMessageLogger" />
        </client>
    </system.serviceModel>

-----------------------------------------------------------------------------------------------------------------------------------

My WebConfig is:

<system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="RDCompute_WebRole.MessageLoggerBehavior">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service behaviorConfiguration="RDCompute_WebRole.MessageLoggerBehavior"
                name="RDCompute_WebRole.MessageLogger">
                <endpoint address="" binding="basicHttpBinding" contract="RDCompute_WebRole.IMessageLogger">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            </service>
        </services>
      <serviceHostingEnvironment>
        <baseAddressPrefixFilters>
          <add prefix="http://localhost:5100/>
        </baseAddressPrefixFilters>
      </serviceHostingEnvironment>
    </system.serviceModel>

推荐答案

您已经为http://localhost定义了baseAddressPrefixFilter: 5100 .但是您的服务托管在localhost:81.更新baseAddressPrefixFilters部分,或在项目设置中将端口81更改为5100.
You have baseAddressPrefixFilter defined for http://localhost:5100. But your service hosts at localhost:81. Either update baseAddressPrefixFilters section or change port 81 to 5100 in project settings.


这篇关于找不到与绑定BasicHttpBinding的端点匹配方案http的基地址.注册的基址方案为[].的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆