SergeiM.Soap 0.1.1

dotnet add package SergeiM.Soap --version 0.1.1
                    
NuGet\Install-Package SergeiM.Soap -Version 0.1.1
                    
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="SergeiM.Soap" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SergeiM.Soap" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="SergeiM.Soap" />
                    
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 SergeiM.Soap --version 0.1.1
                    
#r "nuget: SergeiM.Soap, 0.1.1"
                    
#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 SergeiM.Soap@0.1.1
                    
#: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=SergeiM.Soap&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=SergeiM.Soap&version=0.1.1
                    
Install as a Cake Tool

SergeiM.Soap

SOAP client library built on top of SergeiM.Http. Follows the same immutable-fluent API style as BaseRequest / BaseResponse.

Installation

dotnet add package SergeiM.Soap

Requires net8.0 or later.

Quick start

using SergeiM.Soap;

var response = new SoapRequest("https://example.com/service.asmx")
    .SoapAction("http://example.com/GetUser")
    .Envelope()
        .WithNamespace("svc", "http://example.com/")
        .WithBody("<svc:GetUser><svc:Id>42</svc:Id></svc:GetUser>")
        .Back()
    .Fetch();

response.AssertStatus(200).AssertNoFault();

var ns = new XmlNamespaceManager(new NameTable());
ns.AddNamespace("svc", "http://example.com/");
var name = response.Envelope.EvaluateXPath("//svc:Name", ns);

SOAP 1.1 (default)

var response = new SoapRequest("http://www.dneonline.com/calculator.asmx")
    .SoapAction("http://tempuri.org/Add")
    .Envelope()
        .WithNamespace("t", "http://tempuri.org/")
        .WithBody("<t:Add><t:intA>7</t:intA><t:intB>3</t:intB></t:Add>")
        .Back()
    .Fetch();

response.AssertStatus(200).AssertNoFault();
// result == "10"
var result = response.Envelope.EvaluateXPath("//t:AddResult", ns);

SOAP 1.2

Pass SoapVersion.Soap12 and an IWire:

var response = new SoapRequest("http://www.dneonline.com/calculator.asmx",
        new HttpWire(), SoapVersion.Soap12)
    .SoapAction("http://tempuri.org/Add")
    .Envelope()
        .WithNamespace("t", "http://tempuri.org/")
        .WithBody("<t:Add><t:intA>7</t:intA><t:intB>3</t:intB></t:Add>")
        .Back()
    .Fetch();

Content-Type is set to application/soap+xml with the action parameter appended automatically.

Bring your own request

Supply a pre-configured IRequest (auth headers, custom wire, retries, etc.):

IRequest inner = new BaseRequest("https://secure.example.com/soap", myWire)
    .Method("POST")
    .Header("Authorization", "Bearer " + token);

var response = new SoapRequest(inner)
    .Envelope()
        .WithBody("<svc:Ping/>")
        .Back()
    .Fetch();

Fault handling

try
{
    response.AssertNoFault();
}
catch (SoapFaultException ex)
{
    Console.WriteLine(ex.Fault.Code);    // e.g. "env:Sender"
    Console.WriteLine(ex.Fault.Reason);
}

Or use the fluent form that throws on non-200 or a SOAP fault:

response.AssertStatus(200).AssertNoFault();

Conventional Commits

This project follows Conventional Commits to automate versioning and changelog generation via release-please.

Type Purpose Bump
feat New feature minor
fix Bug fix patch
docs Documentation only changes
style Code style (formatting, whitespace)
refactor Code refactoring
test Adding or updating tests
chore Maintenance (CI, deps, etc.)

Breaking changes are signaled with ! after the type (feat!:) or a BREAKING CHANGE: footer — triggers a major bump.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.1.1 49 6/24/2026
0.1.0 127 2/26/2026