0
votes

i have one service with two endpoint. one endpoint is for wsdual binding and another for tcp binding. when i start my wcf service with wcfsvchost.exe like

WcfSvcHost.exe /service:"C:
\Users\TRIDIP\Documents\Visual Studio 2010\Projects\BBAChatService\BBAChatService\bin
\BBAChatService.dll" /config:"C:\Users\TRIDIP\documents\visual studio 2010\Projects
\BBAChatService\BBAChatService\Web.config"

then my service was started.

the problem is when i try to create proxy at client side after starting service with WcfSvcHost.exe then all endpoints related info gets added in client's config file but i want that when i will create proxy with tcp mex endpoint or mexHttpBinding from client side then only valid endpoint should be added in client's config file not all endpoints. so guide me what to change in my config file at service end. here is my config file at service end....please have look.

<service name="BBAChatService.ChatService" behaviorConfiguration="BBAChatService.ChatServiceBehavior" >
        <host>
          <baseAddresses>
            <add baseAddress ="http://localhost:8732/ChatService.svc/"/>
            <add baseAddress ="net.tcp://localhost:7998/ChatService/"/>
          </baseAddresses>
        </host>

        <endpoint name="dual_bind"
                  address="dual"
                  binding="wsDualHttpBinding" 
                  bindingConfiguration="WSDualHttpBinding_IChatService" 
                  contract="BBAChatService.IChatService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

        <endpoint name="tcp_bind"
              address="tcp"
              binding="netTcpBinding"
              bindingConfiguration="tcpBinding"
              contract="BBAChatService.IChatService">
        </endpoint>

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


      </service>

guide me what to change in my config. thanks

1
I'm not sure whether this is possible. When hiding one endpoint here, clients that do need them cannot generate a proxy class anymore. You have no control over the 'tool' used by the consumer.Myrtle

1 Answers

1
votes

If you expose multiple endpoints in the same service you have multiple ports in WSDL and svcutil (Add service reference) will import configuration for every offered port. WSDL always exposes all defined endpoints for the service and svcutil works with all of them.

You must either manually modify your client config to remove HTTP endpoint configuration on the client side or you must split your service to two different implementations each with single endpoint.