【发布时间】:2010-10-28 21:40:01
【问题描述】:
我对以下配置文件有几个问题:
<system.serviceModel>
<bindings />
<services>
<service behaviorConfiguration="WcfReporting.Service1Behavior"
name="WcfReporting.Service1">
<endpoint address=""
binding="basicHttpBinding" bindingConfiguration=""
contract="WcfReporting.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:5050/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfReporting.Service1Behavior" >
<!-- To avoid disclosing metadata information, set the value below to false
and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment to
avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
为什么当我按 F5 重新启动服务时,服务以这个 URL http://localhost:2752/ 开始...为什么不是我在 baseAddresses 中指定的 5050。
如何添加另一个端点。我尝试使用端点地址="/Address2" binding="basicHttpBinding" contract="WcfReporting.IService1" />
我应该如何访问该服务,不仅可以使用http://localhost/VirtualDir/,还可以使用http://localhost/VirtualDir/address2,或者它是如何工作的?
【问题讨论】: