小编Chr*_*ris的帖子

在包含webHttp和wsHttp的VS2010中添加服务引用时出错

我正在创建一个带有wsHttp和JSON端点的web服务.下面的配置托管在一个网站项目中工作正常,除非我尝试在网站上创建服务引用.端点行为似乎导致错误:

"扩展错误'webHttp'无法添加到此元素.验证异常是否在system.servicemode/extensions/behaviorExtensions的扩展集合中注册"

它不会在svcUtil.exe中引发错误.看起来VS具体,但我想深究它.

 <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="JSON">
          <webHttp />
        </behavior>
      </endpointBehaviors>
        <serviceBehaviors>
            <behavior name="HelloWorldBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="HelloWorldBehavior" name="HelloWorld">
          <endpoint address="/json" behaviorConfiguration="JSON"
            binding="webHttpBinding" contract="IHelloWorld" >
            </endpoint>
          <endpoint name="wcf"  address="" binding="wsHttpBinding"
          contract="IHelloWorld" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

service wcf reference

3
推荐指数
1
解决办法
725
查看次数

标签 统计

reference ×1

service ×1

wcf ×1