none
Multiple endpoints with different behaviors RRS feed

  • Question

  • Hello!  I was trying to add multiple endpoints with different bindings and was hoping to add different behaviors to each endpoint but I keep getting an error stating that the behavior isn't found.

    What I ended up having to do is use a single behavior for the endpoints, such as the following:

    <service behaviorConfiguration="serviceBehavior" name="Test.Operations">
            <endpoint name="BasicHttp_Test" address="http://localhost:8601/Test/Operations/" binding="basicHttpBinding"  contract="IOperations"/>
            <endpoint name="NetTcp_Test" address="net.tcp://localhost:8602/Test/Operations/" binding="netTcpBinding"  contract="IOperations"/>
           
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8601/Test/Operations/"/>
                <add baseAddress="net.tcp://localhost:8602/Test/Operations/"/>
              </baseAddresses>
            </host>
          </service>

    If I try to set the behaviorConfiguration at the <endpoint> element I always get an error.  Is it possible to set a different behavior for each endpoint?

    Thank you very much!!!

    Sunday, March 8, 2015 9:20 AM

Answers

  • Hi Hiline1961,

    I wonder if you mean that when you set the behaviorConfiguration at the <endpoint> element as following then you will meet an error stating that the behavior isn't found.

     <endpoint name="BasicHttp_Test" address="http://localhost:8601/Test/Operations/" 
    binding="basicHttpBinding" behaviorConfiguration="web" contract="IOperations"/>
    If so, please try to make sure that you have configured the endpoint behaviorConfiguration as following in your config file:
    <behaviors>
          <endpointBehaviors>
            <behavior name="web">
              ......
            </behavior>
          </endpointBehaviors>

    If I have misunderstood you, please try to post the StackTrace from the exception as @Joel Engineer said.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Monday, March 23, 2015 2:11 AM
    Moderator

All replies

  • Does it work if you try each baseAddress one at a time?  Can you post the StackTrace from the exception?

    jdweng

    Sunday, March 8, 2015 10:32 AM
  • Hi Hiline1961,

    I wonder if you mean that when you set the behaviorConfiguration at the <endpoint> element as following then you will meet an error stating that the behavior isn't found.

     <endpoint name="BasicHttp_Test" address="http://localhost:8601/Test/Operations/" 
    binding="basicHttpBinding" behaviorConfiguration="web" contract="IOperations"/>
    If so, please try to make sure that you have configured the endpoint behaviorConfiguration as following in your config file:
    <behaviors>
          <endpointBehaviors>
            <behavior name="web">
              ......
            </behavior>
          </endpointBehaviors>

    If I have misunderstood you, please try to post the StackTrace from the exception as @Joel Engineer said.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Monday, March 23, 2015 2:11 AM
    Moderator