WCF service with the basic interface HttpBinding and netTcpBinding; cannot access http endpoint

I want to make the same interface available with netTcpBinding and basicHttpBinding. I also want to provide wsdl for both endpoints. When I turn to http://localhost:9876/TestService/, I get a mex endpoint that has information for Tcp endoint in http://localhost:9876/TestService/?wsdl, but the address is http://localhost:9876/TestService/wsnot responding, and I cannot understand why. I have a base address and relative address. Can someone lend me a hand indicating what is missing? Right now, I'm just trying to start the TestImplementation service, and I have not messed up the MessaginImplementation service.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="SimpleBinding" />
            </basicHttpBinding>
            <netTcpBinding>
                <binding name="DefaultTCPBinding" transactionFlow="true" />
            </netTcpBinding>
        </bindings>
        <behaviors>
            <serviceBehaviors>
                <behavior name="MetadataBehavior">
                    <serviceMetadata httpGetEnabled="true" httpGetBinding="webHttpBinding"
                        httpGetBindingConfiguration="" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service behaviorConfiguration="MetadataBehavior" name="CompanyX.AppServer.Implementation.TestImplementation">
                <endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultTCPBinding"
                    name="TestTCPEndpoint" contract="CompanyX.AppServer.Interfaces.ITest" />
                <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                    name="TestMex" contract="IMetadataExchange" />
                <endpoint address="/ws" binding="basicHttpBinding" bindingConfiguration="SimpleBinding"
                    name="Test" contract="CompanyX.AppServer.Interfaces.ITest" />
                <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://localhost:9878/TestService" />
                        <add baseAddress="http://localhost:9876/TestService/" />
                    </baseAddresses>
                </host>
            </service>
            <service behaviorConfiguration="MetadataBehavior" name="CompanyX.AppServer.Implementation.MessaginImplementation">
                <endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultTCPBinding"
                    name="MessagingTCPEndpoint" contract="CompanyX.AppServer.Interfaces.IMessaging" />
                <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                    name="MessagingMex" contract="CompanyX.AppServer.Interfaces.IMessaging" />
                <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://localhost:9878/MessagingService" />
                        <add baseAddress="http://localhost:9876/MessagingService" />
                    </baseAddresses>
                </host>
            </service>
        </services>
    </system.serviceModel>
</configuration>
+3
2

. . . , HTTP-, wsdl, .

+1

, :

<endpoint address="/ws" binding="basicHttpBinding" bindingConfiguration="SimpleBinding"
                name="Test" contract="CompanyX.AppServer.Interfaces.ITest" />

( ), ws - :

<endpoint name="Test" 
          address="ws" 
          binding="basicHttpBinding" bindingConfiguration="SimpleBinding"
          contract="CompanyX.AppServer.Interfaces.ITest" />

! .

0

Source: https://habr.com/ru/post/1779649/


All Articles