嘿,我已經做了一個WCF服務,並希望能夠連接到它與我設置的DNS?因爲它現在我必須通過計算機ip向baseaddress conncet。 和DHCP有時會給新的IP,然後客戶端必須知道新的IP等等......你希望得到它:)用名稱而不是IP連接到WCF服務
所以我怎麼能通過名稱來連接它呢?而像baseaddress已本地主機
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="metaAndErrors"
name="VenatoWCF.WCFService">
<endpoint address="http://localhost:8732/End"
binding="basicHttpBinding"
contract="VenatoWCF.IService">
<identity>
<dns value="dendei"/>
</identity>
</endpoint>
<endpoint address="http://localhost:8732/mex"
binding="mexHttpBinding"
contract="IMetadataExchange">
<identity>
<dns value="dendei"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/VenatoWCFconsole/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metaAndErrors">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
一直在努力這樣的事情,但沒有運氣XD,我想從客戶端與連接的「http:// dendei:8732/VenatoWCFconsole /」
所以即使如果我的IP更改客戶端不必更改連接到我
謝謝你的答案!
你是如何託管WCF的? IIS? – alan
@alan它是自主託管的 – Dendei