locked
regarding multiple base address wcf RRS feed

  • Question

  • User88744855 posted

    here i am attaching one config entries because i have couple of question for config

    entries...please have a look

    <service name="WCFService.Service" behaviorConfiguration="behaviorConfig">

    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:1645/ChatServer/"/>
        <add baseAddress="http://localhost:1648/ChatServer/"/>
      </baseAddresses>
      </host>
      <endpoint address="tcp"
                      binding="netTcpBinding"
                      bindingConfiguration="tcpBinding"
                      contract="ChatService.IChat"/>

     <endpoint address="net.tcp://localhost:1645/ChatServer/mex"
                      binding="mexTcpBinding"
                      contract="IMetadataExchange"/>

     </service>

    a) tell me why two base address is given. the person who wrote this config entries why he

    write two base address....any idea??

    b) just see the tcp endpoint why the person construct the tcp endoint this way rather he
    could write tcp endpoint like this way

    <endpoint address="net.tcp://localhost:1645/ChatServer/"
                      binding="netTcpBinding"
                      contract="ChatService.IChat" />

    c) why he wrote the tcp url in mex endpoint rather he could write mex endpoint like
    <endpoint address="mex"
                      binding="mexHttpBinding"
                      contract="IMetadataExchange" />

    but he did not write in this way....is there any special reason.

    Friday, December 28, 2012 10:42 AM

Answers

  • User-1662538993 posted

    tell me why two base address is given. the person who wrote this config entries why he

    You can have multiple way of hosting the service like here net.tcp is one protocol and another is http.

    When you host your service you can define how many and which way you want to host like net.tcp,http,https,msmq.

    You can consume this with any one like net.tcp or http.

    The Metadata Exchange Endpoint (MEX) is a special endpoint in WCF that exposes metadata used to describe a service. 

    Check this link for mex endpoint -

    http://jeffbarnes.net/blog/post/2006/10/16/metadata-exchange-endpoint.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 28, 2012 1:30 PM