我在Web应用程序的IIS中托管简单的WCF服务。
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SimpleServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SimpleServiceBehavior" name="SimpleService">
<endpoint address="" binding="basicHttpBinding" contract="ISimpleService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
当我运行托管在http://projects.mydomain.com/application/SimpleService.svc上的服务时,它会显示带有WSDL链接的默认服务页面: svcutil.exe http://terminal.mydomain.local/application/SimpleService.svc?wsdl等等
客户端可以创建服务引用但无法执行方法,因为无法解析主机名terminal.mydomain.local 问题是为什么服务器名称是其本地名称'terminal.mydomain.local'而不是'projects.mydomain.com'?