Question

My program is a WCF service which publishes several methods and have multiple client. It store list of clients in the database. In some of the methods I need to query the caller's data from the database. This question How can service know the caller? and the linked answer Get the Client’s Address in WCF shows how to get the IP of the caller. However, normally the address field in my clients table don't have IP, but stuff like:

http://localhost:80/
http://computerName:80/
http://computerName.domain.com:80/

Which are valid endpoint addresses. Let's imagine I use the solution in the linked answer, and I get the IP of my caller (say http://192.80.212.21:80/). However in the database, the client is stored as http://computerName:80/ How can I check that these two addresses are the same, so that I can get the corresponding client's entry from the database?

The number of clients is very small, so performance issue from iterating every row in the database can be negligible.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top