簡體   English   中英

WCF找不到與綁定MetadataExchangeHttpBinding的端點的方案http匹配的基地址

[英]WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

我正在嘗試讓wcf服務在Windows服務主機中工作。 我當前收到錯誤消息“找不到與綁定MetadataExchangeHttpBinding的端點的方案http匹配的基地址。注冊的基地址方案為[net.tcp]。”

我正在使用.Net Framework 4.5

我正在嘗試獲取tcp.net二進制服務。 任何幫助表示贊賞。 我創建的跟蹤文件沒有幫助。 這是我的[已修訂] app.config:

 <?xml version="1.0" encoding="utf-8" ?> <!-- IMPORTANT! To run this on your local machine, first follow instructions in http://support2.microsoft.com/kb/2785590 --> <!-- You will run into tcp listen errors otherwise --> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <system.serviceModel> <services> <service name="SettingsDB.Configuration" behaviorConfiguration="DefaultBehavior"> <endpoint binding="netTcpBinding" bindingConfiguration="max" contract="SettingsDB.IConfiguration" address="Settings" /> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:9000/SettingsService" /> </baseAddresses> </host> </service> </services> <bindings> <netTcpBinding> <binding name="max" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" listenBacklog="2147483647" transactionFlow="false" portSharingEnabled="true"> <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /> <reliableSession enabled="false" /> <security mode="None" /> </binding> </netTcpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="DefaultBehavior"> <serviceMetadata httpGetEnabled="false" httpGetUrl="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true"> <listeners> <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\\Traces.svclog" /> </listeners> </source> </sources> </system.diagnostics> <system.web> <compilation debug="true" /> </system.web> <runtime> <gcServer enabled="true" /> </runtime> </configuration> 

你能試一下嗎:

<service name="SettingsDB.Settings">

為行為添加名稱,並將httpGetUrl更改為true

<behavior>
  <serviceMetadata httpGetEnabled="true" 
                   httpGetUrl="true"     />
  <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM