Skip to content
Xharze edited this page Sep 22, 2012 · 1 revision

Calls the specified web service on each log message.

Supported in .NET, Silverlight, Compact Framework and Mono. ##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>

##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.

Clone this wiki locally