嘿,我已经做了一个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