/SoapDatasetHell

Converts a Diffgram (Dataset sent by a WCF Webservice) into a Dataset.

Primary LanguageC#OtherNOASSERTION

SoapDatasetHell

Software engineers used to share datasets throught WCF Webservices. Nowadays, it's not a good practice, but, there are many serivces written in this way.

In .Net Core, there isn't an easy way to read these legacy datasets.

This lib get XML result and converts it into a DataSet object.

Nuget

downloads
stable Nuget

Get help

Gitter

Follow me on Twitter: @andersonribeiro

Install with nuget

Install-Package dev.andersonribeiro.SOAPDatasetHell -Version 1.0.0

Install with .NET CLI

dotnet add package dev.andersonribeiro.SOAPDatasetHell --version 1.0.0

How to use

Create an instance of SoapToDatasetClient and set properties:

* Credentials;
* SOAP Endpoint URL;
* SOAP Namespaces;
* SOAP Body;

After, call SoapToDatasetClient.GetDataSet() to retrieve Dataset from WCF Webservice.

Something like this:

SoapToDatasetClient soapClient = new SoapToDatasetClient("http://wssupplier/wsPortal/ws_listPriority.asmx");
soapClient.Credentials = new NetworkCredential("username", "password");
soapClient.NameSpaces.Add(@"xmlns:ran=""http://www.ranger.com/""");
soapClient.SoapBody = $@"
<ran:WS_Priority_Call>
<ran:in_Param>
<ran:IntegrationSystem>2</ran:IntegrationSystem>
</ran:in_Param>
</ran:WS_WS_Priority_Call>"
DataSet dataSet = await soapClient.GetDataSet();