Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a client's address from a WCF Service Application?

How can I get a client's address from a WCF Service Application? Also, is there an event raised when a client connects, possibly with address information?

like image 559
MGSoto Avatar asked Jul 10 '09 21:07

MGSoto


People also ask

Where can I find WCF client?

You can typically find the WCF Test Client (WcfTestClient.exe) in the following location: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE - Community may be one of "Enterprise", "Professional" or "Community" depending on which level of Visual Studio is installed.

What is address in WCF service?

Address: The address uniquely identifies the endpoint and tells potential consumers of the service where it is located. It is represented in the WCF object model by the EndpointAddress class. An EndpointAddress class contains: A Uri property, which represents the address of the service.

How would you specify a method is available to access by client in WCF?

With the service running, right click the project that will contain the WCF client proxy and select Add > Service Reference. In the Add Service Reference Dialog, type in the URL to the service you want to call and click the Go button. The dialog will display a list of services available at the address you specify.

What is address binding and contract in WCF?

ABC means Address, Binding and Contract. Address: In WCF, every service is associated with a unique address. The address provides two important elements: the location of the service and the transport protocol or transport schema used to communicate with the service.


2 Answers

In 3.0, this is quite hard; but was improved in 3.5 (read Detect Client IP in WCF 3.5). I'm not aware of an event, though.

like image 141
Marc Gravell Avatar answered Oct 13 '22 10:10

Marc Gravell


Which address are you looking for? The IP address?

If so, I hope you're aware of the limitations on that - it won't be accurate if the client's on the other side of a NAT device or Internet proxy.

like image 22
John Saunders Avatar answered Oct 13 '22 11:10

John Saunders