• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 802
  • Last Modified:

WCF service application - Get computer name

Hi all,

I've just started to write a Web Service application and I'd like to know how can I get (old) servervariables inside my method ?

I'd just want to know the computer name of the client (the IP is ok also) to process with it.

  • 4
  • 2
2 Solutions
SybuxAuthor Commented:
Thx, in fact, i'm already using the method descibed in your 2nd link but when I call my service from my application, I got this error message :

The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

Do you know how to activate th debug function easyly ?
Anil GolamariCommented:

You can follow the steps in this link to get the log file and see what is causing the problem in the service
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

SybuxAuthor Commented:
I've added this :

      <trace autoflush="true" />
        <source name="System.ServiceModel"
                switchValue="Information, ActivityTracing, Error"
            <add name="sdt"
                initializeData= "mystack.e2e" />

but there is no trace file.
SybuxAuthor Commented:
I've found my problem.

I'm using the following code :


to get the remote_host value but HTTPCONTEXT is an empty object. It seems that it's not the good way to do or that I need to initiate it before.
SybuxAuthor Commented:
The question is not answer. So keep it open or close but I don't agree to split answer as it is not !
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now