Solved

WCF service application - Get computer name

Posted on 2010-08-27
7
785 Views
Last Modified: 2013-11-27
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.

Thx.
Sybux
0
Comment
Question by:Sybux
  • 4
  • 2
7 Comments
 
LVL 18

Accepted Solution

by:
Anil Golamari earned 500 total points
ID: 33543356
0
 

Author Comment

by:Sybux
ID: 33543428
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 ?
0
 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 500 total points
ID: 33543564
http://msdn.microsoft.com/en-us/library/ms732023.aspx

You can follow the steps in this link to get the log file and see what is causing the problem in the service
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:Sybux
ID: 33544062
I've added this :

     </system.web>
 
    <system.diagnostics>
      <trace autoflush="true" />
      <sources>
        <source name="System.ServiceModel"
                switchValue="Information, ActivityTracing, Error"
                propagateActivity="true">
          <listeners>
            <add name="sdt"
                type="System.Diagnostics.XmlWriterTraceListener"
                initializeData= "mystack.e2e" />
          </listeners>
        </source>
      </sources>
    </system.diagnostics>

but there is no trace file.
0
 

Author Comment

by:Sybux
ID: 33556121
I've found my problem.

I'm using the following code :

HttpContext.Current.Request.ServerVariables("REMOTE_HOST")

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.
0
 

Author Comment

by:Sybux
ID: 33724204
The question is not answer. So keep it open or close but I don't agree to split answer as it is not !
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question