Solved

WCF service application - Get computer name

Posted on 2010-08-27
7
782 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now