简体   繁体   中英

The message could not be dispatched because the service at the endpoint address net.tcp://localhost/ is unavailable for the protocol of the address

I am developing a WCF service in Visual Studio 2012. The following is the web.config file:

  <system.serviceModel>
    <client>
      <endpoint address="net.tcp://localhost/BlueYonder/Booking" binding="netTcpBinding" contract="BlueYonder.BookingService.Contracts.IBookingService" name="BookingTcp">
        <identity>
          <certificateReference storeLocation="LocalMachine" storeName="TrustedPeople" x509FindType="FindBySubjectName" findValue="Server"/>
        </identity>
      </endpoint>
    </client>
    <bindings>
      <netTcpBinding>
        <binding>
          <security mode="Message">
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior>
          <clientCredentials>
            <serviceCertificate>
              <authentication revocationMode="NoCheck" />
            </serviceCertificate>
            <clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="Client"/>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>

I have also enabled net.tcp binding in IIS. In addition, I have check the required service (listeners) are running.

However, I am getting the following error message:

EndPointNotFoundException

There was no endpoint listening at net.tcp://localhost/BlueYonder/Booking that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

You can try couple of things step-by-step

  1. Make sure all required services are running. Go to local service and check for following services. SEE THE IMAGE ! 1
  2. As you said that you have already enabled net.tcp binding in IIS so its Good. 3.Make sure that your HTTP port and NET.TCP port are different preferably http on 80 and NET.TCP on 808.
  3. Restart the IIS and Update the service reference in client application.
  4. Check if any new service referance added for NET.TCP than use new one, Delete the old one which you have already created.

Make sure you do point 4 and 5(if you have already done point 1 to 3) If you are still facing some problem check that your IIS is register for ASP.NET 4.5 or any other version which you are using. Command for registering Asp.net for IIS is aspnet_regiis -i . run Visual studio developper command prompt as Administrator then launched C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319>aspnet_regiis -i

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM