views:

20

answers:

1

I need to test WCF service, but have only one computer, so my service and client are running on the same machine. Here is the App.config of WCF Service:

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

I need to connect to this service from my client by IP, so i tried 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 doesn't work anyway - client cann't connect to service.

  1. Does it possible to connect by IP if I use wsDualHttpBinding, and if yes,
  2. What Endpoint.Address should I specify for it
+1  A: 

You need to specify an address something like this:

http://127.0.0.1:8000/MyService

You need to put a : between the IP address and the port number - not a / as you seem to use (at least in your post).

marc_s
thank you very much! soooo stupid mistake
Nike