Reputation: 1357
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"/>
</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.
Upvotes: 3
Views: 17022
Reputation: 754220
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).
Upvotes: 2