Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting Requester Info In WCF Service
    primarykey
    data
    text
    <p>I am working on a service that will support mobile applications on the Android, BlackBerry, iOS, and WP7 platforms. These applications will connect to various REST-based WCF services that I am working on. I would like to see what information a client application passes to my service. In an effort to do this, I've written the current operation in my WCF service:</p> <pre><code>[OperationContract] [WebGet(UriTemplate = "/GetRequesterInfo")] public string GetRequesterInfo() { OperationContext context = OperationContext.Current; string message = "Session ID: " + context.SessionId; return message; } </code></pre> <p>When I call this code, I notice that the <code>SessionId</code> is an empty string. In addition, I would like to get as much information about the client as possible. For instance, if this were ASP.NET, I could use the <code>HttpRequest</code> object and get:</p> <ul> <li>HttpMethod</li> <li>IsLocal</li> <li>IsSecureConnection</li> <li>RequestType</li> <li>Url.AbsoluteUri</li> <li>Url.OriginalString</li> <li>UserAgent</li> <li>UserHostAddress</li> <li>UserHostName</li> <li>Browser.Id</li> <li>Browser.Browser</li> <li>Browser.CanInitiateVoiceCall</li> <li>Browser.ClrVersion.Minor</li> <li>Browser.Cookies</li> <li>Browser.EcmaScriptVersion</li> <li>Browser.GatewayVersion</li> <li>Browser.InputType</li> <li>Browser.MobileDeviceManufacturer</li> <li>Browser.MobileDeviceModel</li> </ul> <p>While there are more properties, I'm sure you get the idea. This leads me to several questions:</p> <ol> <li>How do I get the request thread associated with the request to my WCF service? I thought that's what OperationContext was for. But I'm open to correction.</li> <li>How do I get all of the property name / values associated with a request to a WCF service?</li> <li>Am I asking for something that makes sense or am I off my rocker? It seems like I should be able to get some info about the requesting client. </li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload