Reading SOAP / WCF client Request XML Response XML And HTTP Headers with system.servicemodel behavior and message inspector
To troubleshoot issues you need to log SOAP request, response XML, and response HTTP headers. You can use an endpoint behavior and a message inspector to achieve it. See the below sample — it will call a public service: https://www.crcind.com/csp/samples/SOAP.Demo.cls Project File <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net9.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="System.ServiceModel.Http" Version="8.1.2" /> </ItemGroup> </Project> Program.cs using SoapAddIntegerDemo; using System; using System.ServiceModel; using System.Threading.Tasks; class Program { static async Task Main() { var binding = new BasicHttpBinding(); binding.Security.Mode = Basic...