我有一个 wcf 服务,我尝试使用 svcutil 和向客户端测试项目添加服务引用来添加它。在这两种情况下,都没有创建新的配置文件,随后客户端测试将不会运行,因为它没有看到端点。为什么会这样,这是我的 WCF 服务的 web.config 文件。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="webHttpBinding" crossDomainScriptAccessEnabled="true" />
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="webHttpBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="webHttpBehavior" name="WcfInstanceRules2.Service1">
<endpoint address=""
binding="webHttpBinding" bindingConfiguration="webHttpBinding"
contract="WcfInstanceRules2.IService1"
behaviorConfiguration="web"/>
</service>
</services>