Technical FAQs

Ask a Question

Enabling WCF Tracing for WebRealTime Service in PME 7.2/8.0

Issue
Looking to enable WCF [Windows Communication Foundation] Tracing for WebRealTime Service in PME 7.2/8.0

Product Line
StruxureWare Power Monitoring Expert

Environment
Power Monitoring Expert 7.2, Power Monitoring Expert 8, Internet Explorer 11

Cause
Enabling the 
WCF Tracing for WebRealTime Service in PME allows the user to collect and analyze diagnostic data from web applications in order to resolve technical issues.

Resolution
NOTE:  Ensure that a copy of the 'Web.config' file is backed up to a secure location on the server prior to proceeding with the file modifications.

1. Stop the Application Modules CoreServicesHost, DataServicesHost and ProviderEngineHost services
2. Make a backup copy of the Web.config file for the WebRealTime service, which you can find at the following location:  <PME installation folder>\system\WebServices
3. Add the following section to the Web.config file:

<system.diagnostics>
      <sources>
            <source name="System.ServiceModel" 
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
            <listeners>
               <add name="traceListener" 
                   type="System.Diagnostics.XmlWriterTraceListener" 
                   initializeData= "C:\Log\WebRealTimeTrace.svclog" />
            </listeners>
         </source>
      </sources>
   </system.diagnostics>


NOTE:  You can change where the trace file gets saved to on the hard drive by changing the value for initializeData. 

4. Enable the IncludeExceptionDetailInFaults by referring to the steps below where minor modification will be performed to the 'Web.config' file for the Web real-time service:
  • Make a backup copy of the Web.config file for the WebRealTime service, which you can find at the following location:  <PME installation folder>\system\WebServices
    E.g.  C:\Program Files (x86)\Schneider Electric\Power Monitoring Expert\system\WebServices\Web.config
     
  • Perform another modification to the Web.config file in order to include detailed exception information:
    Find the <behaviors> section underneath <system.serviceModel>
     
  • Change the includeExceptionDetailInFaults value to "true" as in the following (changes are underined):
    • <behaviors>
          <serviceBehaviors>
              <behavior name="">
                  <serviceMetadata httpGetEnabled="true" />
                  <serviceDebug includeExceptionDetailInFaults="true" />
              </behavior>
              <behavior name="metadata">
                  <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
              </behavior>
          </serviceBehaviors>
      </behaviors>
5. Run the iisreset command from a command prompt
6. Restart the ApplicationModules services

To stop the tracing, follow the steps below:

1. Stop the three ApplicationModules services
2. Restore the backup copy of the Web.config file for the WebRealTime service which was backed up earlier, to the following location:  <PME installation folder>\system\WebServices

OR

 Remove the following section to the Web.config file:

<system.diagnostics>
      <sources>
            <source name="System.ServiceModel" 
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
            <listeners>
               <add name="traceListener" 
                   type="System.Diagnostics.XmlWriterTraceListener" 
                   initializeData= "C:\Log\WebRealTimeTrace.svclog" />
            </listeners>
         </source>
      </sources>
   </system.diagnostics>


Change the includeExceptionDetailInFaults value to "true" as in the following (changes are underined):
  • <behaviors>
        <serviceBehaviors>
            <behavior name="">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <behavior name="metadata">
                <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
            </behavior>
        </serviceBehaviors>
    </behaviors>

Start a network trace in Internet Explorer by following the instructions below:

1. Log into Web Applications and navigate to the Tables tab.
2. Press the F12 key and a new section will appear at the bottom of the screen as shown below.



3. Click the "Start capturing" button and diagnostic information will appear in the trace at the bottom of the screen:



To stop tracing, click the "Stop capturing" button.
 
Was this helpful?
What can we do to improve the information ?