Michael Meritt
Michael Meritt

Reputation: 393

Address of WCF Service on remote machine?

If I have a machine running a WCF service, what would the address be for it on a different machine on network?

http://localhost:8080/api/stages = ???

Upvotes: 0

Views: 252

Answers (1)

Sandeep Saran
Sandeep Saran

Reputation: 36

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

Upvotes: 1

Related Questions