REST Service Calls for .NET - 1.2


Compatibility: v2 v3 Express
What's new? Release Notes
ID: com.castsoftware.dotnet.service

Description

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

Supported REST client libraries

Library Supported Versions
System.Net.Http.HttpClient .NET Framework 4.5+ → .NET 10 (inbox BCL)
System.Net.Http.Json.HttpClientJsonExtensions .NET 5 → .NET 10 (inbox BCL)
System.Net.HttpWebRequest .NET Framework 1.1+ → .NET 10 (legacy API)
Windows.Web.Http.HttpClient Windows 8.1 → present (legacy Windows-only API)
Refit 1.0.x → 10.0.x
RestEase 0.9.x → 1.6.x
RestSharp (RestClient) 104.0.x → 113.1.x
Flurl.Http 0.1.x → 4.0.x

Transactions

Transaction support is derived from metamodel concepts used to build CAST Imaging Blueprint and structural transaction flows. Entry Points start transactions; Exit Points include both output/boundary concepts and Data Entities manipulated by transactions.

Role Support Breakdown
Entry Point No direct concept type details
Exit Point
  • Web Services Call

Data version: 1.2.0-beta2

ISO 5055 Structural Rules

Quality support is based on ISO 5055 structural rules available for the selected extension version. Counts are grouped by ISO 5055 characteristic.

Reliability Maintainability Security Performance Efficiency

Data version: 1.2.0-beta2

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 is not automatically handled when downloading the REST Service Calls for .NET extension, therefore you must ensure that the .NET Analyzer is downloaded and installed before starting an 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

Refitexternal link 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

Icon Object Type Created when
Dotnet Delete Resource Service HTTP verb is DELETE
Dotnet Get Resource Service HTTP verb is GET
Dotnet Post Resource Service HTTP verb is POST
Dotnet Put Resource Service HTTP verb is PUT
Dotnet Patch Resource Service HTTP verb is PATCH
Dotnet Unknown Resource Service HTTP verb is unidentified and no default defined

Rules

None.

Limitations

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