我有basicHttpBindings簡單的wcf服務,並希望在IIS上承載它。如何指定IIS上託管的WCF服務的端點地址?
但是當我指定 <endpoint address="/myAddress" binding="basicHttpBinding" contract="Wcf.Contracts.IPublicService"/>
myAddress被忽略。換句話說,我期待它創建我的服務端點,像這個localhost:1111/myaddress/PublicService.svc,但它只是通過組合localhost和PublicService.svc - localhost:1111/publicservice.svc來創建端點。
爲什麼我需要? 我有一些其他的服務託管在項目中,並希望在localhost後用不同的URL創建它們(我不想將它們移動到不同的文件夾中)。
我已經使用Google搜索並發現在IIS上託管時主機基地址被忽略,這對於端點地址也是如此嗎?
在此先感謝
<service name="Wcf.Services.AdminService">
<endpoint address="/address" binding ="basicHttpBinding" contract="Wcf.Contracts.IAdminService"/>
<endpoint address="mex" binding ="mexHttpBinding" contract="IMetadataExchange"/>
</service>
<service name="Wcf.Services.PublicService">
<endpoint address="/address1" binding="basicHttpBinding" contract="Wcf.Contracts.IPublicService"/>
<endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange"/>
</service>
如果您將服務放在名爲「myAddress」的文件夾中,路徑將從/PublicService.svc - > /myAddress/PublicService.svc更改。如果你想將它們全部存儲在一個地方,但不同的路徑,你應該看看添加ServiceRoutes。 – Zachary
但爲什麼我們需要端點地址,如果它不能「適當」使用?他們只用於Windows服務中的自我託管服務嗎? – Lev