Developer forum

Forum » Integration » Best way to call and configure SOAP service in Dynamicweb 10

Best way to call and configure SOAP service in Dynamicweb 10

Jelle Deridder
Reply

Hello,

We need to integrate a SOAP-based price service into our Dynamicweb 10 solution.

  • Request: customer number + list of product numbers

  • Response: gross/net price, discount, and optional price scales

  • The service should be executed in batch mode several times per day

Question:
What is the recommended approach in Dynamicweb 10 to:

  1. Configure and call such a SOAP service (with batch requests)?

  2. Map the response data back into product pricing in DW10?

Any advice, best practices, or examples are very welcome.

Kind regards,
Jelle


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Jelle,
you can try to use the Endpoint Management and one of the import data addins for this task.
In the Endpoint management you can setup the endpoint that can connect to your SOAP service.
Then install one of the import data add-ins: Import data custom request add-in or if you are using the pagination response you can use the Import data with paging add-in.
Make a new scheduled task that will use the installed add-in.
In the task add-in settings you need to select your configured endpoint and select the DataIntegration job that can be run after getting the service response.
The Data Integration job needs to be with XmlProvider selected as a source provider. You can create a sample source xml file and make a mappings in the Data Integration job,
then once the response xml is received from the service the source xml file will be overwritten with a new response content.

BR, Dmitrij

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

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)

 

You must be logged in to post in the forum