WCF: how to connect to the service by IP: port

I need to check the WCF service, but only have one computer, so my service and client work on the same computer. Here is the WCF service app.config:

<host>
   <baseAddresses>
       <add baseAddress="http://localhost:8000/MyService"/>
   </baseAddresses>
</host>
<endpoint address=""
    binding="wsDualHttpBinding"
    contract="MyService.IMyService"/> 

I need to connect to this service from my client over IP, so I tried the following:

 MyClient.Endpoint.Address = 
        new System.ServiceModel.EndpointAddress(
             new Uri("http://" + IP + "/" + Port + "/MyService"));

where IP = "127.0.0.1" and Port = "8000". I also tried to use my real IP address instead of 127.0.0.1, but it still doesn’t work - the client cannot connect to the service.

  • Is it possible to connect via IP, if I use wsDualHttpBinding, and if so, then
  • Which endpoint .Address should be specified for it
+3
source share
1 answer

:

http://127.0.0.1:8000/MyService

: IP- , /, , , ( , ).

+2

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


All Articles