我正在向IIS 7部署WCF服务,当我导航到服务URL时,我得到一个这样的页面:
我没有像这样的典型登陆页面(从网上复制只是为了展示示例,数据模糊以保护无辜者):
有人能告诉我我做错了什么吗?该服务按预期工作,但此服务的用户无需查看以了解方法是什么或在何处获取WSDL。
以下是我的相关文件:
App.Config (在服务项目中,并作为IIS的Web.Config复制到服务站点)
<system.web>
<compilation debug="true"/>
</system.web>
<system.serviceModel>
<services>
<service name="MyService.MyService" behaviorConfiguration="Web">
<clear />
<endpoint address=""
binding="wsHttpBinding"
name="ws"
behaviorConfiguration="Web"
contract="MyService.IMyService" />
<!--
<endpoint address=""
behaviorConfiguration="Web"
binding="webHttpBinding"
bindingConfiguration=""
name="web"
contract="MyService.IMyService" />
-->
<host>
<baseAddresses>
<add baseAddress="http://services.mydomain.com/MyService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Web">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="Web">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
MyService.svc
<%@ ServiceHost Service="MyService.MyService"
Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>
我也尝试使用'webHttpBinding'而不是'wsHttpBinding',但它似乎没有什么区别。
答案 0 :(得分:0)
ServiceHost Service =“MyService.MyService”...这条线是否正确?