none
How to stop exposing multiple endpoint at client side in WCF RRS feed

  • Question

  • suppose my wcf has many end point with different binding.so when user / client add service ref from VS IDE at then multiple endpoint related data expose & added in client config file at client side.

    Can we design service in such a way as a result only one endpoint related address will be revealed at client side?

    Suppose I have one service with HTTP & TCP related endpoint and I want when external customer will add our service from their VS IDE then they will see our HTTP endpoint address not TCP. So guide me how could I do this? How to design service end config file for my requirement?

    here i am attaching a small sample code for multiple endpoint related in config file.

    <services>
                <service behaviorConfiguration="MulContractService" name="MyWCFLibrary.MultipleContract">
                    <clear />
                    <endpoint binding="basicHttpBinding" bindingConfiguration="MulContractBasicBinding"
                        name="MulContractBasicEndPoint" contract="MyWCFLibrary.IMultipleContract"
                        listenUriMode="Explicit">
                        <identity>
                          <dns value="localhost" />
                            <certificateReference storeName="My" storeLocation="LocalMachine"
                                x509FindType="FindBySubjectDistinguishedName" />
                        </identity>
                    </endpoint>
                    <endpoint address="test1" binding="wsHttpBinding" bindingConfiguration="MulContractWsHttpBinding"
                        name="MulContractWsHttp" contract="MyWCFLibrary.IByeWorld"
                        listenUriMode="Explicit">
                        <identity>
                          <dns value="localhost" />
                            <certificateReference storeName="My" storeLocation="LocalMachine"
                                x509FindType="FindBySubjectDistinguishedName" />
                        </identity>
                    </endpoint>
                    <endpoint address="test1" binding="wsHttpBinding" bindingConfiguration="MulContractWsHttpBinding"
                        name="MulContractWsHttp" contract="MyWCFLibrary.IHelloWorld"
                        listenUriMode="Explicit">
                        <identity>
                          <dns value="localhost" />
                            <certificateReference storeName="My" storeLocation="LocalMachine"
                                x509FindType="FindBySubjectDistinguishedName" />
                        </identity>
                    </endpoint>
                    <endpoint address="net.tcp://localhost:8733/Design_Time_Addresses/MyWCFLibrary/MultipleContract/"
                        binding="netTcpBinding" bindingConfiguration="MulContractTCPBinding"
                        name="MulContractTCPEndPoint" contract="MyWCFLibrary.IMultipleContract" />
                    <host>
                        <baseAddresses>
                            <add baseAddress="http://localhost:8732/Design_Time_Addresses/MyWCFLibrary/MultipleContract/" />
                        </baseAddresses>
                    </host>
                </service>
            </services>
    Wednesday, September 24, 2014 2:20 PM

All replies

  • Hi,

    WCF includes a number of standard bindings that allow you to quickly configure a service for a particular set of protocols. Clients must use compatible protocols when they communicate with each endpoint. Services can expose multiple endpoints for the same service contract in order to expose functionality over different protocols. For example, a service may be called by internal clients over TCP, but by external clients over HTTP. In addition to supporting different protocols, internal and external clients may not have access to the same service contracts. Some operations may be allowed only by clients within the domain, while others are publicly available to remote clients on the Internet.

    Here is the detailed information about exposing Multiple Service Endpoints within the link below:

    http://www.safaribooksonline.com/library/view/learning-wcf/9780596101626/ch01s07.html

    Regards

    Thursday, September 25, 2014 7:29 AM
    Moderator
  • i hard that we can write single service and single contract but we can have two service tag in config file pointing to that service. can you please give me a example like that. thanks
    Thursday, September 25, 2014 8:04 AM
  • the link u gave not serve my purpose. thanks
    Friday, September 26, 2014 8:02 AM