我的雇主网站有多个主机名,都是同一个服务器,我们只是显示不同的皮肤来进行品牌宣传.
不幸的是,在这种情况下,WCF似乎不能很好地工作.
我试过overriding the default host with a custom host factory.
这不是一个可以接受的解决方案,因为它需要从所有主机工作,而不仅仅是1.
我也看过this blog post,但是我无法让它工作,或者不是为了解决我的问题.
我得到的错误是“这个集合已经包含一个地址与方案http”
有一个配置方法,请帮忙:)
解决方法
如果您不在终端中放置地址,那么它应该解析为任何服务器访问该服务.我使用这个代码,它解决了我的.local地址和我的.com地址从IIS.
<system.serviceModel> <services> <service name="ServiceName" behaviorConfiguration="ServiceName.Service1Behavior"> <endpoint address="" binding="wsHttpBinding" contract="iServiceName"> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceName.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="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。