AppFabric Hosting - Custom WCF binding and behavior configuration not used

ロック済み AppFabric Hosting - Custom WCF binding and behavior configuration not used

  • Tuesday, December 14, 2010 5:44 PM
     
     

    Hello,

    We are hosting WCF Services (netTcpBinding) in AppFabric through WAS.

    The issue we are facing is that our named binding AND behavior configurations are not used while the service is hosted in AppFabric (see below for the config section that illustrates it).

    It is the default ("") binding and behavior configurations (defined by default at the server level) that are used instead.

    Also if we look inside the AppFabric management console, on the service configuration (general section), we can see that our service is using the service defaults as it says: "Currently using default behavior: Yes" and the "Use Default" is disabled.

    Here is our WCF config file:

    <system.serviceModel>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
        <bindings>
          <netTcpBinding>
            <binding name="netTcpBinding_Afda" transferMode="Buffered" maxReceivedMessageSize="777777">
              <readerQuotas maxDepth="1024" />
            </binding>
          </netTcpBinding>
        </bindings>

        <behaviors>
          <endpointBehaviors>
            <behavior name="EndpointBehavior_Afda">
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </endpointBehaviors>

          <serviceBehaviors>
            <behavior name="ServiceBehavior_Afda">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
        </behaviors>

        <services>
          <service name="Afda_PatientenServices" behaviorConfiguration="ServiceBehavior_Afda">
            <endpoint name="netTcpEndpoint" behaviorConfiguration="EndpointBehavior_Afda" binding="netTcpBinding" bindingConfiguration="netTcpBinding_Afda" contract="Afda.Services.Contracts.IAfda_PatientenService" />
            <host>
              <timeouts closeTimeout="00:01:00" />
            </host>
          </service>

     </system.serviceModel>

    Any idea why this is happening?

    I read all over the place that we can have named binding and behavior configurations used by just defining it and referencing it through the bindingConfiguration and behaviorConfiguration attributes...but it doesn't work for me while hosting my services in AppFabric.

    One more thing that may help to understand the problem better is that I can see the following warnings when I enable WCF tracing:

    <DataItem>
    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
    <TraceIdentifier>http://msdn.microsoft.com/nl-BE/library/System.ServiceModel.OverridingDuplicateConfigurationKey.aspx</TraceIdentifier>
    <Description>The configuration system has detected a duplicate key in a different configuration scope and is overriding with the more recent value.</Description>
    <AppDomain>/LM/W3SVC/1/ROOT/AfdaServices-31-129368164277805915</AppDomain>
    <Source>System.ServiceModel.Configuration.ServiceBehaviorElementCollection/246134838</Source>
    <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/DictionaryTraceRecord">
    <ElementName>behavior</ElementName>
    <Name></Name>
    <OldElementLocation></OldElementLocation>
    <OldElementLineNumber>0</OldElementLineNumber>
    <NewElementLocation></NewElementLocation>
    <NewElementLineNumber>0</NewElementLineNumber>
    </ExtendedData>
    </TraceRecord>
    </DataItem>

    <DataItem>
    <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
    <TraceIdentifier>http://msdn.microsoft.com/nl-BE/library/System.ServiceModel.EvaluationContextNotFound.aspx</TraceIdentifier>
    <Description>Configuration evaluation context not found.</Description>
    <AppDomain>/LM/W3SVC/1/ROOT/AfdaServices-31-129368164277805915</AppDomain>
    </TraceRecord>
    </DataItem>

    Thank you in advance for your help...

    Kind regards,

    Olivier Van Hege


    Olivier Van Hege (CTG - olivier.van_hege@ctg.com)

All Replies

  • Thursday, December 16, 2010 2:41 AM
     
     Answered

    The service name here <service name="Afda_PatientenServices

    should be full service name

    In console when you click on services you will get the full service name here, this should be the same as the name in config

    Thanks

    --Vikram

  • Monday, December 20, 2010 11:30 AM
     
     

    Thank you, Vikram.

    Using the service fullname as service name in the configuration file solved the problem.

    I did not know that we had to follow that naming rule (which is logic and good, by the way) here.

    Thank you again for your support...

    Kind regards,

    Olivier


    Olivier Van Hege (CTG - olivier.van_hege@ctg.com)