I have a .Net 4.0 WCF service running on IIS. I have not specified a port so assume it is running on port 80. I need to install my service on a server where port 80 is alrea
We can do it using the .csproj file of the WCF project(in case of using VS).Just change the value of this xml tag in your corresponding file:
To Run the service at port number 60000 ,
<DevelopmentServerPort>60000</DevelopmentServerPort>
I am assuming you are running your services on net.tcp protocols.
1) Edit your bindings (right click Default Web Site
select Edit Bindings
2) Server Side
<service name="YouServiceNameSpace.YourService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="YourBinding" contract="YourContract" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
</service>
3) Client Side
<endpoint address="net.tcp://YourHost:443/YourServiceDirecotry/YourService.svc"
behaviorConfiguration="YourBehavior" binding="netTcpBinding"
bindingConfiguration="YourTcpBinding" contract="YourContract"
name="YourContractName" />
Normally you should have a services node with at least one service node and each having endpoints, where you can specify the port. See more at: http://msdn.microsoft.com/en-us/library/ms733932.aspx
For example:
<services>
<service name="MyNamespace.myServiceType">
<endpoint
address="net.tcp://0.0.0.0:8000" binding="basicHttpBinding"
bindingConfiguration="myBindingConfiguration1"
contract="MyContract" />
</service>
</services>
Specify the port in the address of the endpoint. See the 'Defining Endpoint Addresses in Code' section in this article for more details.