如何设置在IIS 7的基本路径承载WCF应用程序? [英] How to set the base path in IIS 7 hosting a WCF application?
问题描述
我已经通过迁移(previously自承载)的WCF应用IIS7的过程中打我的方式(我从来没有使用IIS之前,我意识到这是一个非常简单的问题,但我失败了谷歌/故答案为止)。
我的服务托管在 http://xxx.xxx.xxx.xxx/SampleWebsite/Service.svc
但是当我访问它与 ?WSDL
所有应该读 http://xxx.xxx.xxx.xxx/
实际上是设置窗口机器的本地网络名称引用(即的http:// localpc3 /
)。
我已经使用WCF工具的外部IP地址添加到下我配置服务,以及一些内部的IIS管理器中设置的基址部分尝试,但我似乎无法追查正确的的地方。
在哪里设置这个? IIS管理器中,web.config中,别的地方?
可能是重复的:
<一href="http://stackoverflow.com/questions/470111/wcf-not-using-my-domain-name-but-rather-my-computer-name-when-viewing-myservice">WCF不使用我的域名
答:
改变它在配置数据库:
的Cscript.exe%SYSTEMDRIVE%\的Inetpub \ adminscripts \ ADSUTIL.VBS
设置SVC / your_website_identifier_here / ServerBindings:80:myserver.example.com
是的,你必须修改IIS元数据库。 在这里看到:
HTTP ://gavinmckay.word$p$pss.com/2009/03/24/howto-fix-wcf-host-name-on-iis/
I've been fighting my way through the process of migrating a (previously self-hosted) WCF application to IIS7 (I've never used IIS before and I realise that this is a very simplistic question but I failed to google/SO the answer so far).
My service is hosted at http://xxx.xxx.xxx.xxx/SampleWebsite/Service.svc
but when I access it with ?wsdl
all the references that should read http://xxx.xxx.xxx.xxx/
are actually set to the window machine's local network name (i.e. http://localpc3/
).
I've tried using the WCF tool to add the external IP address to the base address section under the service I'm configuring as well as a number of settings inside IIS manager but I can't seem to track down the correct place.
Where do I set this? IIS manager, web.config, somewhere else?
May be a duplicate:
WCF not using my domain name
Answer:
Change it in the metabase:
cscript.exe %systemdrive%\inetpub\adminscripts\adsutil.vbs
set W3SVC/your_website_identifier_here/ServerBindings ":80:myserver.example.com"
Yes, you have to modify the IIS Metabase. See here:
http://gavinmckay.wordpress.com/2009/03/24/howto-fix-wcf-host-name-on-iis/
这篇关于如何设置在IIS 7的基本路径承载WCF应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!