WCF路由Custombinding会话错误

时间:2012-10-30 15:21:27

标签: c# wcf session soap

我目前正在尝试针对WSDL编写一个小的WCF-Routing应用程序。但是当我尝试访问SVC文件时,我收到以下错误:

  

合同需要Session,但Binding'BasicHttpBinding'不需要   支持它或未正确配置以支持它。

由于我正在使用SOAP12的自定义绑定,因此我不理解此错误消息。我已经在这里搜索了,但唯一的其他相关主题只有一条评论没有帮助我。 (https://stackoverflow.com/questions/9896593/wcf-4-routing-service-and-configuration-error

我的web.config如下:

<?xml version="1.0"?>

<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
        <compilation debug="false" targetFramework="4.0">
        </compilation>
        <authentication mode="Windows"/>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    <system.serviceModel>

        <services>
            <service name="RoutingService" behaviorConfiguration="RoutingServiceBehavior">
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost/FrontendSoap/Routingservice.svc"/>
                    </baseAddresses>
                </host>
                <endpoint name="RequestReplyBinding" binding="customBinding" bindingConfiguration="AnfragenBulk" contract="System.ServiceModel.Routing.IRequestReplyRouter"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="RoutingServiceBehavior">
                    <serviceMetadata httpsGetEnabled="True"/>
                    <routing filterTableName="routingFilterTable"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>

        <client>
            <endpoint name="VerfuegbarkeitAnfragenBulkPort" address="http://localhost/BackendSoap/BackendBulkService.svc" binding="customBinding" bindingConfiguration="AnfragenBulk" contract="VerfuegbarkeitAnfragenBulkService.VerfuegbarkeitAnfragenBulk"/>
        </client>
        <routing>
            <filters>
                <filter name="WebIFFilter" filterType="EndpointName" filterData="RequestReplyBinding"/>
            </filters>
            <filterTables>
                <filterTable name="routingFilterTable">
                    <add filterName="WebIFFilter" endpointName="VerfuegbarkeitAnfragenBulkPort"/>
                </filterTable>
            </filterTables>
        </routing>

        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
        <bindings>
      <customBinding>
        <binding name="AnfragenBulk">
          <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
              messageVersion="Soap12" writeEncoding="utf-8">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          </textMessageEncoding>
          <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
              maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
              bypassProxyOnLocal="true" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
              keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
              realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
              useDefaultWebProxy="true" />
        </binding>
      </customBinding>
        </bindings>
    </system.serviceModel>
</configuration>

和RoutingService.svc:

<%@ ServiceHost Language="C#" Debug="true" Service="System.ServiceModel.Routing.RoutingService, System.ServiceModel.Routing, version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

非常感谢任何帮助和想法。

0 个答案:

没有答案
相关问题