Posted on 08/09/2025 23:02:36
You can also use a price provider you code your self to calculate prices - it does exacty what you are asking for. See https://doc.dynamicweb.dev/api/Dynamicweb.Ecommerce.Prices.PriceProvider.html
SOAP coding as changed in asp.net core if you need to code your own price provider to get the prices - som info below by AI.
Consuming SOAP services from ASP.NET Core / .NET 8
TL;DR: SOAP itself isn’t “deprecated.” What changed is that server-side WCF wasn’t brought to .NET Core. But SOAP clients are fully supported in modern .NET via the WCF client libraries and tooling. You can either (1) generate a typed client from WSDL or (2) hand-roll requests with HttpClient
.
Option 1 — Generate a typed client (recommended)
Use one of the official tools to point at the WSDL and generate a strongly-typed proxy:
-
Visual Studio → Add > Connected Service > WCF Web Service, then paste the service URL. This adds a ServiceReference
and the required System.ServiceModel.*
packages. (Microsoft Learn)
-
Or the CLI tool:
dotnet tool install -g dotnet-svcutil
dotnet-svcutil https://service.example.com?wsdl
This generates the proxy classes you can call from .NET 6/7/8 projects. (Microsoft Learn, NuGet)
Typical usage (after generation):
var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport); // or match the service
var endpoint = new EndpointAddress("https://service.example.com/Service.svc");
var client = new ServiceClient(binding, endpoint);
var result = await client.SomeOperationAsync(new SomeRequest { /*...*/ });
Tip: Make sure your binding matches the service (e.g., BasicHttpBinding
, WSHttpBinding
, or a CustomBinding
for SOAP 1.2). Mismatched bindings are the #1 cause of “content type not supported” errors. (Microsoft Learn)
Support status: Microsoft maintains the WCF client packages (e.g., System.ServiceModel.Http
, System.ServiceModel.Primitives
, System.ServiceModel.NetTcp
) for modern .NET. (Microsoft)
Option 2 — Call SOAP with HttpClient
(when you can’t use WSDL)
If you don’t have a WSDL or need a very lightweight call, you can post the SOAP envelope yourself:
var xml = @"<?xml version=""1.0"" encoding=""utf-8""?>
<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">
<s:Body>
<m:SomeOperation xmlns:m=""http://tempuri.org/"">
<m:Arg>value</m:Arg>
</m:SomeOperation>
</s:Body>
</s:Envelope>";
using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://service.example.com/Service.svc");
req.Content = new StringContent(xml, Encoding.UTF8, "text/xml"); // or "application/soap+xml" for SOAP 1.2
req.Headers.Add("SOAPAction", "http://tempuri.org/ISvc/SomeOperation"); // SOAP 1.1 only
var resp = await http.SendAsync(req);
var body = await resp.Content.ReadAsStringAsync();
Remember: SOAP 1.1 usually needs Content-Type: text/xml
+ SOAPAction
header; SOAP 1.2 uses Content-Type: application/soap+xml
and no SOAPAction
. (Stack Overflow)
Hosting SOAP in .NET (if you ever need it)
If you later need to host SOAP endpoints on .NET 6/8, use CoreWCF (community project with Microsoft support) to run WCF-style services on ASP.NET Core. This is separate from consuming a service. (GitHub)