Ads by Lake Quincy Media

Wiki Navigation

 
Gibraltar - Learn about the best analysis tool for NLog

WebService target

NLog documentation is a Wiki, which allows registered users to edit its content.
If you want to contribute, please create a user account and contact Jarek to get edit access.

Calls the specified web service on each log message. 

Supported in

Configuration Syntax

<targets>
  <target xsi:type="WebService"
          name="String"
          url="System.Uri"
          encoding="Encoding"
          protocol="Enum"
          namespace="String"
          methodName="String">
    <parameter layout="Layout" name="String" type="System.Type"/><!-- repeated -->
  </target>
</targets>
Read more about using the Configuration File.

Parameters

  • General Options
  • name - Name of the target.
  • Parameter Options
  • parameters - The array of parameters to be passed.Collection
    Each collection item is represented by <parameter /> element with the following attributes:
    • layout - Layout that should be use to calcuate the value for the parameter.Layout Required.
    • name - Name of the parameter.
    • type - Type of the parameter.System.Type
  • Web Service Options
  • url - Web service URL.System.Uri
  • encoding - Encoding.Encoding
    This parameter is not supported in:
    • NLog v1.0 for .NET Compact Framework 1.0
    • NLog v1.0 for .NET Compact Framework 2.0
    • NLog v1.0 for .NET Framework 1.0
    • NLog v1.0 for .NET Framework 1.1
    • NLog v1.0 for .NET Framework 2.0
  • protocol - Protocol to be used when calling web service. Default: Soap11
    Possible values:
    • HttpGet - Use HTTP GET Protocol.
    • HttpPost - Use HTTP POST Protocol.
    • Soap11 - Use SOAP 1.1 Protocol.
    • Soap12 - Use SOAP 1.2 Protocol.
  • namespace - Web service namespace.
  • methodName - Web service method name.

Remarks

The web service must implement a method that accepts a number of string parameters.

Ads by Lake Quincy Media