Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
How to ping a WCF service through c# code which is installed on different server (locally) on net.tcp
or get Response / availability of WCF service

XML
<baseAddresses>
           <add baseAddress="net.tcp://localhost/example.User"/>
         </baseAddresses>


Through c# code
Posted
Updated 23-Feb-14 21:22pm
v2

1 solution

You cannot ping a service. There is no such concept. "Ping" has some strict meaning: it is a separate service implementing a special protocol (ICMP) and a utility for pinging:
http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol[^],
http://en.wikipedia.org/wiki/Ping_%28networking_utility%29[^].

So, you can only pick the system itself if it implements the protocol ICMP (normally, it should). You can ping using the class System.Net.NetworkInformation.Ping:
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping%28v=vs.110%29.aspx[^].

—SA
 
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