wcf endpoint relative address

主宰稳场 提交于 2019-12-04 03:20:01

You should be able to define a base address for your net.tcp service endpoints:

<service name="YourServiceName">
   <host>
       <baseAddresses>
          <add baseAddress="net.tcp://localhost:808/psh_pub/" />
       </baseAddresses>
   </host>

Then you should be able to use relative addresses in your actual endpoints:

   <endpoint name="Tcp01"
             address="pshservice.svc" 
             binding="netTcpBinding" 
             contract="wcf_service_auth.IPshService" />
</service>

WCF file-less activation (.Net 4.0) will let you register under a relative virtual path using the relativeAddress attribute:

<system.serviceModel>
  <serviceHostingEnvironment>
    <serviceActivations>
      <add relativeAddress="relative-virtual-path/yourservice.svc"
           service="YourServiceImpl" />
    </serviceActivations>
  </serviceHostingEnvironment>
</system.serviceModel>

relative to the base address of the Web application

This link talks about it: http://msdn.microsoft.com/en-us/library/ee354381.aspx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!