Solved

WCF service application - Get computer name

Posted on 2010-08-27
7
793 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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