SOAP extensions and wrapper for Flurl.Http
$ dotnet add package Flurl.Http.Soap
Very basic extension for Flurl to support the SOAP protocol.
This is very much a half-baked, early implementation. It currently only implements a ReceiveSoap method, with a simple SoapEnvelope wrapper class.
string soapXmlString =
@"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">
<soap:Body>
<RequestBody>
<ApiField>Test</ApiField>
</RequestBody>
</soap:Body>
</soap:Envelope>";
ResponseBody responseBodyContent = await "https://api.url/endpoint"
.PostXmlAsync(soapXmlString)
.ReceiveSoap<ResponseBody>();