Click here to Skip to main content
15,903,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please clarify me.

I am inintializing ServiceHost for windowservice as following and confused about httpUrl.

ServiceHost Host = new ServiceHost(typeof(WCFWindowsHositngService.SimpleCalculator), httpUrl);

How can i write httpUrl

1. Uri httpUrl = new Uri("http://localhost:8090/MyService/SimpleCalculator");
or
2. Uri httpUrl = new Uri("C:/MyService/SimpleCalculator");
Or
3. Uri httpUrl = new Uri("computerno//C:/MyService/SimpleCalculator");
Posted
Comments
Ramu Sangabathula Original 7-Apr-11 20:38pm    
you mean did you host your wcf service as a windows service, and accessing the hosted service from client, and don't know how to frame the url?
[no name] 11-Apr-11 0:44am    
Yes. Please let me know about url

if you are using netTCPBinding, url format will be like

net.tcp://servername:portnumber/ServiceName

for Http Protocol (basichttp,wshttp)

http://servername:portnumber/Servicename

for netnamedpipebinding.

net.pipe://localhost/Servicename
 
Share this answer
 
Comments
[no name] 12-Apr-11 1:14am    
Thank you very mutch
It depends on the binding that you are using for your WCF service. If you use basicHttpBinding and your service listens on port 8090, option 1 is the URL that you should use.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900