This documentation is not maintained. Please refer to doc.castsoftware.com/technologies to find the latest updates.

Extension ID

com.castsoftware.dotnet.service

What's new?

See REST service call for .NET - 1.0 - Release Notes for more information.

Description

This extension provides support for some web services calls from C#.

Supported REST client libraries

Native
  • Windows.Web.Http.HttpClient
  • System.Net.Http.HttpClient
  • System.Net.HttpWebRequest
Third-party
  • Refit
  • RestSharp.RestClient
    • RestSharp.RestClient.Execute
    • RestSharp.RestClient.GetAsync
    • RestSharp.RestClient.PostAsync
    • ...
  • Flurl.Http

Function Point, Quality and Sizing support

This extension provides the following support:

  • Function Points (transactions): A green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
  • Quality and Sizing: A green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points
(transactions)
Quality and Sizing
(tick)(error)

CAST AIP compatibility

This extension is compatible with:

CAST AIP release

Supported

8.3.x(tick)

Supported DBMS servers

This extension is compatible with the following DBMS servers:

CAST AIP releaseCSSOracleMicrosoft
All supported releases(tick)(tick)(error)

Prerequisites

(tick)Installation of any compatible release of CAST AIP (see table above)

Dependencies with other extensions

The REST Service Calls for .NET extension requires that ≥ 1.3.4-funcrel or ≥ 1.4.1-funcrel of the .NET Analyzer is also installed and used in order to ensure the most complete set of results. This dependency with the .NET Analyzer is not automatically handled when downloading the REST Service Calls for .NET extension via CAST Extension Downloader, CAST Server Manager or AIP Console, therefore you must ensure that the .NET Analyzer is downloaded and installed before starting an analysis.

Download and installation instructions

Please see:

The latest release status of this extension can be seen when downloading it from the CAST Extend server.

Packaging, delivering and analyzing your source code

Package your .NET code as described in .NET - Prepare and deliver the source code - the REST Service Calls for .NET extension will be run when you perform the analysis.

What results can you expect?

Features

This extension analyzes web service calls made from C# code through classic fluent APIs. For example with System.Net.Http.HttpClient:

using System;
using System.Net.Http;

class Main
{
    void main()
    {
        var httpClient = new HttpClient();
        
        HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get,"hello/world");
        
        httpClient.SendAsync(request);
    }
}

Refit

Refit provides the means to call web services through interfaces with attributes. Therefore, analyzing:

using System.Threading.Tasks;
using Refit;

public interface IGitHubApi
{
    [Get("/users/{user}")]
    Task<string> GetUser(string user);
}

will create:

Objects

The following objects are displayed in CAST Enlighten:

IconDescription

Dotnet Delete Resource Service

Dotnet Get Resource Service

Dotnet Post Resource Service

Dotnet Put Resource Service
Dotnet Patch Resource Service

Rules

None.

Limitations

  • When the code uses a custom URL builder, we cannot evaluate the URL.
  • Configuration files are not  taken into account