C# Class Google.Api.Ads.Common.Lib.TraceListener

Listens to SOAP messages sent and received by this library.
Inheritance: Google.Api.Ads.Common.Lib.SoapListener
Exibir arquivo Open project: Zocdoc/googleads-adwords-dotnet-lib

Public Methods

Method Description
CleanupAfterCall ( ) : void

Cleans up any resources after an API call.

HandleMessage ( XmlDocument soapMessage, AdsClient service, SoapMessageDirection direction ) : void

Handles the SOAP message.

InitForCall ( ) : void

Initializes the listener for handling an API call.

Protected Methods

Method Description
AppendHeadersToSoapXml ( string soapRequest, string headers ) : string

Appends the HTTP headers to SOAP xml.

FormatHttpRequest ( string soapRequest ) : string

Creates a formatted http request text, to be written into HTTP logs.

FormatHttpResponse ( string soapResponse ) : string

Creates a formatted http response text, to be written into HTTP logs.

FormatSoapRequest ( WebRequest webRequest, string soapRequest ) : string

Creates a formatted soap request text, to be written into SOAP logs.

FormatSoapResponse ( WebResponse webResponse, string soapResponse ) : string

Creates a formatted soap response text, to be written into SOAP logs.

GetFieldsToMask ( ) : string[]

Gets a list of fields to be masked in xml logs.

GetTimeStamp ( ) : string

Gets the current timestamp as a formatted string.

MaskCredentialsInLogs ( XmlDocument soapMessageXml, string fieldNames ) : void

Masks a list of fields in the SOAP message before logging it.

TraceListener ( AppConfig config ) : System

Protected constructor.

Private Methods

Method Description
PerformLogging ( AdsClient service, string soapRequest, string soapResponse ) : void

Performs the SOAP and HTTP logging.

Method Details

AppendHeadersToSoapXml() protected method

Appends the HTTP headers to SOAP xml.
protected AppendHeadersToSoapXml ( string soapRequest, string headers ) : string
soapRequest string The SOAP request.
headers string The HTTP headers.
return string

CleanupAfterCall() public method

Cleans up any resources after an API call.
public CleanupAfterCall ( ) : void
return void

FormatHttpRequest() protected method

Creates a formatted http request text, to be written into HTTP logs.
protected FormatHttpRequest ( string soapRequest ) : string
soapRequest string The request xml for this SOAP call.
return string

FormatHttpResponse() protected method

Creates a formatted http response text, to be written into HTTP logs.
protected FormatHttpResponse ( string soapResponse ) : string
soapResponse string The response xml for this SOAP call.
return string

FormatSoapRequest() protected method

Creates a formatted soap request text, to be written into SOAP logs.
protected FormatSoapRequest ( WebRequest webRequest, string soapRequest ) : string
webRequest System.Net.WebRequest The web request for this SOAP call.
soapRequest string The request xml for this SOAP call.
return string

FormatSoapResponse() protected method

Creates a formatted soap response text, to be written into SOAP logs.
protected FormatSoapResponse ( WebResponse webResponse, string soapResponse ) : string
webResponse System.Net.WebResponse The web response for this SOAP call.
soapResponse string The response xml for this SOAP call.
return string

GetFieldsToMask() protected abstract method

Gets a list of fields to be masked in xml logs.
protected abstract GetFieldsToMask ( ) : string[]
return string[]

GetTimeStamp() protected method

Gets the current timestamp as a formatted string.
protected GetTimeStamp ( ) : string
return string

HandleMessage() public method

Handles the SOAP message.
public HandleMessage ( XmlDocument soapMessage, AdsClient service, SoapMessageDirection direction ) : void
soapMessage System.Xml.XmlDocument The SOAP message.
service AdsClient The SOAP service.
direction SoapMessageDirection The direction of message.
return void

InitForCall() public method

Initializes the listener for handling an API call.
public InitForCall ( ) : void
return void

MaskCredentialsInLogs() protected method

Masks a list of fields in the SOAP message before logging it.
protected MaskCredentialsInLogs ( XmlDocument soapMessageXml, string fieldNames ) : void
soapMessageXml System.Xml.XmlDocument The SOAP message, loaded as an XmlDocument. ///
fieldNames string The list of field names to be masked.
return void

TraceListener() protected method

Protected constructor.
protected TraceListener ( AppConfig config ) : System
config AppConfig The config class.
return System