假设我在IIS中托管了WCF服务,端点中的地址是否可以为空? 我在WCF Tutorial.
看到了一个例子<system.serviceModel>
<services>
<service name="MathService"
behaviorConfiguration="MathServiceBehavior">
<endpoint address="" contract="IMathService"
binding="wsHttpBinding"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MathServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
答案 0 :(得分:1)
如果端点地址为空,则在您实例化服务时,它将使用ServiceHost指定的BaseAddress。