WCF路由服务:filterTable中不允许使用属性“名称” [英] WCF Routing Service: Attribute 'name' is not allowed in filterTable

查看:92
本文介绍了WCF路由服务:filterTable中不允许使用属性“名称”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在设置路由服务。我无法解决错误web.config文件中的filterTable中不允许使用属性'name'。 IIS显示500.19内部服务器错误和



 63:
64: < 路由 >
65:< filterTables >





这是我的web.config:



 <?  xml     version   =  1.0  >  
< 配置 >

< system.web >
< 编译 debug = true targetFramework = 4.0 / >
< / system.web >
< system.serviceModel >

< bindings >
< basicHttpBinding < span class =code-keyword>>
< binding

name = basicHttpBinding_SelfScanApi

maxReceivedMessageSize = 8388608 >
< readerQuotas

< span class =code-attribute> maxDepth = 32

maxStringContentLength = 2147483647

maxArrayLength = 2147483647

< span class =code-attribute> maxBytesPerRead = 2147483647

maxNameTableCharCount = 2147483647 / >
< security mode = / >
< / binding >
< / basicHttpBinding >
< / bindings >

< services < span class =code-keyword>>
< service behaviorConfiguration = RoutingServiceBehavior

name = System.ServiceModel.Routing.RoutingService >
< 主机 >
< baseAddresses >
< add baseAddress = http://localhost/selfscanapi.mdc / >
< / baseAddresses >
< / host >
< endpoint

< span class =code-attribute>
name = RoutingServiceEndpoint

地址 =

binding = basicHttpBinding

bindingConfiguration = basicHttpBinding_SelfScanApi

< span class =code-attribute> 合同 = System.ServiceModel.Routing。 IRequestReplyRouter / >
< / service >
< / services > ;



< client >
< endpoint name = BusinessServerClient

< span class =code-attribute> 地址 = http:// localhost:8393 / SelfScanEnginePlugin / GetStatusEx

binding = basicHttpBinding

bindingConfiguration = basicHttpBinding_SelfScanApi

< span class =code-attribute> contract = * / >
< / client >

< 行为 >
< serviceBehaviors >
< 行为 name = RoutingServiceBehavior >
< 路由

filterTableName = routingTable

< span class =code-attribute> routeOnHeadersOnly = false / >
< serviceDebug includeExceptionDetailInFaults = true / >
< serviceMetadata httpGetEnabled = true / >
< / behavior >
< / serviceBehaviors >
< / behavior >

< 路由 >
< filterTables >
< filterTable name = routingTable >
< < span class =code-leadattribute> add filterName = dataServiceFilter endpointName = BusinessServerClient / >
< / filterTable >
< / filterTables >

< 过滤器 >
< filter name = dataServiceFilter

filterType = 操作

filterData = http://localhost/selfscanapi.mdc/GetStatusEx / >
< / filters >

< / routing >

< / system.serviceModel >
< / configuration >





我找到了很多例子,但没有找到任何有关此特定内容的信息错误。

提前致谢。



Marcel

解决方案

有没有这样的东西 filterTable 。正确的语法是:

 <   filterTables  >  
< table name = routingTable >


我找到了解决方案。

IIS中的应用程序池默认设置为.NET 2.0框架版本。

WCF服务需要4.0版才能使应用程序池正常工作。

Hello,

I'm setting up a routing service. I can't work around the error Attribute 'name' is not allowed in filterTable in the web.config file. IIS shows a 500.19 internal server error and

63:
64:     <routing>
65:       <filterTables>



Here is my web.config:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>

    <bindings>
    <basicHttpBinding>
      <binding

          name="basicHttpBinding_SelfScanApi"

          maxReceivedMessageSize = "8388608">
        <readerQuotas

            maxDepth="32"

        maxStringContentLength="2147483647"

            maxArrayLength="2147483647"

            maxBytesPerRead="2147483647"

            maxNameTableCharCount="2147483647" />
        <security mode="None" />
      </binding>
    </basicHttpBinding>
    </bindings>
    
    <services>
      <service behaviorConfiguration="RoutingServiceBehavior"

               name="System.ServiceModel.Routing.RoutingService">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/selfscanapi.mdc" />
          </baseAddresses>
        </host>
        <endpoint

           name="RoutingServiceEndpoint"

           address="" 

           binding="basicHttpBinding"

           bindingConfiguration="basicHttpBinding_SelfScanApi"

           contract="System.ServiceModel.Routing.IRequestReplyRouter" />
      </service>
    </services>

  

    <client>
      <endpoint name="BusinessServerClient"

                address="http://localhost:8393/SelfScanEnginePlugin/GetStatusEx"

                binding="basicHttpBinding"

                bindingConfiguration="basicHttpBinding_SelfScanApi"

                contract="*" />
    </client>

    <behaviors>
      <serviceBehaviors>
        <behavior name="RoutingServiceBehavior">
          <routing 

              filterTableName="routingTable" 

              routeOnHeadersOnly="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  
    <routing>
      <filterTables>
        <filterTable name="routingTable">
          <add filterName="dataServiceFilter" endpointName="BusinessServerClient" />
        </filterTable>
      </filterTables>

      <filters>
        <filter name="dataServiceFilter"

                filterType="Action"

                filterData="http://localhost/selfscanapi.mdc/GetStatusEx" />
      </filters>
     
    </routing>

  </system.serviceModel>
</configuration>



I found lots of examples but didn't find anything about this specific error.
Thanks in advance.

Marcel

解决方案

There is no such thing filterTable. The correct syntax is:

<filterTables>
  <table name="routingTable">


I found the solution.
The application pool in IIS was default set to .NET 2.0 framework version.
WCF Services need a version 4.0 for the application pool to work.


这篇关于WCF路由服务:filterTable中不允许使用属性“名称”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆