If I have a machine running a WCF service, what would the address be for it on a different machine on network?
Asked
Active
Viewed 249 times
1 Answers
1
When you are hosting your WCF Service, you provide address through endpoint. The remote server will use the same address to access your service. For example, consider the following configuration
<system.serviceModel>
<services>
<service name="ServiceLib.Services.TaskService">
<endpoint address="TaskManager"
binding="wsHttpBinding"
contract="ServiceLib.Contracts.ITaskService" />
</service>
</services>
<serviceHostingEnvironment>
<serviceActivations>
<add service="ServiceLib.Services.TaskService"
relativeAddress="TaskService.svc"/>
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>
In this case, if the service is hosted on IIS with URL of http://localhost:8080/ then the url of your service would be http://localhost:8080/TaskService.svc/TaskManager

Sandeep Saran
- 36
- 3
-
Wow. I think you deciphered my question. Thanks. Do you have the same details if I was to use my Web API project instead of the WCF? – Michael Meritt Jun 03 '16 at 15:55
-
Oh. Is it possible to access the service from a different machine over the network? example: http://[host-name-or-ip]/TaskService.svc/TaskManager ? – Michael Meritt Jun 03 '16 at 15:59