Skip to main content

WCF and Web Service monitoring configuration

You can trace Windows Communication Foundation (WCF) or Web services for the .NET application server.

Configuration guide

The following are agent configuration options for tracing WCF and Web services.

  • webservice_method_enabled Boolean

    Default false

    If the value has been set to true, web services can be traced.

    Note

    To apply the set values, restart IIS.

  • webservice_method_prefix String

    Enter the name of the method to be traced along with the namespace. Because web services cannot be directly traced, directly enter the method that has used the web services as a trace target.

    See the following example:

    whatap.conf
    webservice_method_prefix=Test.Demo, WebServiceDemo.WebService.
    Caution
    • The methods that meet the conditions are traced even if they do not use web services. This feature was intended for WCF and Web services, but can also be used for other purposes.

    • If you enter just the class to which the method belongs, all public methods within that class are to be traced.

    Note

    To apply the set values, restart IIS.

  • webservice_method_prefix_realtime Boolean .NET Agent v2.3.6 or later

    Default false

    If you set the value to true, the target of webservice_method_prefix is processed in real time as the previous.

  • webservice_method_timeout Integer

    Default 5000 (Millisecond, ms)

    If exception handling is not performed in the method to be monitored, it is impossible to know the time when the transaction will end. For such cases, the timeout of web service monitoring occurs by default after 5 seconds. You can adjust the timeout by changing this option value.

Usage examples

Modifying the agent configuration file

See the example for the agent configuration file (whatap.conf) for the WCF and Web service tracing.

whatap.conf
license=...
whatap.server.host=15.165.146.117
whatap.server.port=6600
app_process_name=w3wp.exe
tag_counter_enabled=true
perfcounter.enabled=true
app_name=...
OID=...

webservice_method_enabled=true
webservice_method_prefix=Whatap.Service.Controller, Whatap.DotNet.Examples.Service1
webservice_method_timeout=10000
  • The start and end of a function can be handled as a transaction, if the call path of the method containing the namespace is one of the following:

    Whatap.Service.Controller, Whatap.DotNet.Examples.Service1
  • Because the webservice_method_timeout option has been set to 10,000 (ms), transactions that take more than 10 seconds are automatically terminated.

Tip

In Management > Agent CONF., some options can be added.

Trace analysis

For more information about Agent CONF., see the following.

Example of WCF source code to be monitored

The following WCF source code example guides you to a case to be monitored.

namespace Whatap.DotNet.Examples
{
public class Service1 : IService1
{
public string GetData(int value)
{
...
}

public CompositeType GetDataUsingDataContract(CompositeType composite)
{
...
}

private string getFromDB()
{
...
}

private string getFromHttp()
{
...
}
}

public class Service2 : IService1
{
...
}

public class Service3 : IService1
{
public string IwantToSeeOnlyThis(int value)
{
...
}
}
}

The GetData() method to be monitored belongs to the Service1 class of the Whatap.DotNet.Examples namespace. Therefore, the call path for the method is:

Whatap.DotNet.Examples.Service1.GetData

This is treated as a transaction because it starts from the value (Whatap.DotNet.Examples.Service1) of the webservice_method_prefix specified in the agent configuration file (whatap.conf).

Note
  • The GetDataUsingDataContract() method is to be monitored because it is a public method.

  • The getFromDB() and getFromHttp() methods are excluded from monitoring because they are private methods.