Skip to content

Instantly share code, notes, and snippets.

@NimzyMaina
Last active June 8, 2020 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NimzyMaina/46b6529fe3e8f57e7f0dd9e724e6dca2 to your computer and use it in GitHub Desktop.
Save NimzyMaina/46b6529fe3e8f57e7f0dd9e724e6dca2 to your computer and use it in GitHub Desktop.
Consuming WSDL Services Using ASP.NET Core
using System.Threading.Tasks;
namespace TempConvert.Interfaces
{
[System.ServiceModel.ServiceContractAttribute(
Namespace="https://www.w3schools.com/xml/",
ConfigurationName="TempConvert.Interfaces.ITempConvert")]
public interface ITempConvert
{
[System.ServiceModel.OperationContractAttribute(
Action="https://www.w3schools.com/xml/FahrenheitToCelsius", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
Task<string> FahrenheitToCelsiusAsync(string Fahrenheit);
[System.ServiceModel.OperationContractAttribute(
Action="https://www.w3schools.com/xml/CelsiusToFahrenheit", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
Task<string> CelsiusToFahrenheitAsync(string Celsius);
}
}
using System.ServiceModel;
namespace TempConvert.Interfaces
{
public interface ITempConvertChannel : ITempConvert, IClientChannel
{
}
}
using System.Threading.Tasks;
namespace TempConvert.Interfaces
{
public interface ITempConvertRepository
{
Task<string> FahrenheitToCelsiusAsync(string fahrenheit);
Task<string> CelsiusToFahrenheitAsync(string celsius);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment