SmartWsdlKit.SourceGenerators 1.0.3

Prefix Reserved
dotnet add package SmartWsdlKit.SourceGenerators --version 1.0.3
                    
NuGet\Install-Package SmartWsdlKit.SourceGenerators -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SmartWsdlKit.SourceGenerators" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SmartWsdlKit.SourceGenerators" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="SmartWsdlKit.SourceGenerators" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SmartWsdlKit.SourceGenerators --version 1.0.3
                    
#r "nuget: SmartWsdlKit.SourceGenerators, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SmartWsdlKit.SourceGenerators@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SmartWsdlKit.SourceGenerators&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=SmartWsdlKit.SourceGenerators&version=1.0.3
                    
Install as a Cake Tool

SmartWsdlKit.SourceGenerators

NuGet Version License

SmartWsdlKit.SourceGenerators is a high-performance Roslyn Incremental Source Generator package for the SmartWsdlKit SDK.

It automatically parses local WSDL files at compile-time and generates strongly-typed, modern C# SOAP client proxies, service interfaces, and DTO record models. This eliminates legacy Visual Studio Connected Services, svcutil command line tools, and dynamic runtime reflection overhead completely.


Key Benefits

  • Zero Runtime Reflection: All XML serialization and method mapping logic is generated during compilation for maximum throughput.
  • Instant IDE IntelliSense: Generated proxies are available immediately in your IDE as soon as you save your .wsdl file.
  • Compile-Time Safety & Diagnostics: If the service contract changes or the WSDL is malformed, compiler warnings (SWK001) are reported directly in your build output or IDE error list.
  • Modern C# Code Output: Generates immutable C# 9.0 record types for DTOs and clean async interfaces.

Installation

Add both the core runtime package (SmartWsdlKit) and the source generator package (SmartWsdlKit.SourceGenerators) to your project:

dotnet add package SmartWsdlKit
dotnet add package SmartWsdlKit.SourceGenerators

Setup & Configuration

1. Add your WSDL File

Place your WSDL file (e.g., Calculator.wsdl or CountryInfo.wsdl.xml) in your project directory (e.g., under a Wsdl/ folder).

2. Register WSDL as AdditionalFiles in .csproj

Edit your .csproj file and add the WSDL file inside an <ItemGroup> using the <AdditionalFiles> build action:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>

  
  <ItemGroup>
    <PackageReference Include="SmartWsdlKit" Version="1.0.3" />
    <PackageReference Include="SmartWsdlKit.SourceGenerators" Version="1.0.3" PrivateAssets="all" />
  </ItemGroup>

  
  <ItemGroup>
    <AdditionalFiles Include="Wsdl/Calculator.wsdl" />
  </ItemGroup>

</Project>

3. Build Project

When you build your project (dotnet build), Roslyn will execute the generator and output generated proxy classes under the SmartWsdlKit.Generated namespace.


Consumption Example

using System;
using System.Threading.Tasks;
using SmartWsdlKit;
using SmartWsdlKit.Generated; // Generated namespace containing DTO records & clients

class Program
{
    static async Task Main()
    {
        var options = new SoapClientOptions
        {
            BaseAddress = new Uri("http://www.dneonline.com/calculator.asmx"),
            Timeout = TimeSpan.FromSeconds(10),
            EnableDiagnostics = true
        };

        // Instantiating the generated client proxy
        using var client = new CalculatorSoapClient(options);

        // Invoking the strongly-typed generated operation
        var response = await client.AddAsync(new AddRequest
        {
            intA = 100,
            intB = 250
        });

        Console.WriteLine($"Calculated Result: {response.AddResult}"); // Outputs: 350
    }
}

Diagnostic Rules

The generator analyzes WSDL structures during compilation and reports validation issues directly to the compiler output:

Diagnostic ID Severity Title Description
SWK001 Warning WSDL Parsing Failed Reported when a registered WSDL file is malformed, cannot be read, or imports cannot be resolved.

License

This project is licensed under the MIT License.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 72 8/6/2026
1.0.2 112 6/26/2026
1.0.1 105 6/26/2026
1.0.0 104 6/25/2026