'Create WSDL for an ASP.Net Core ApiController
I am creating a service using ASP.Net Core. The service is based on the ApiController.
[ApiController]
public class XmlALaCarteServiceController : ControllerBase
{
private IXmlALaCarteConnectionProvider _connectionProvider;
public XmlALaCarteServiceController(IXmlALaCarteConnectionProvider connectionProvider)
{
_connectionProvider = connectionProvider;
}
[Route("api/XmlALaCarteService/V1/InitializeConnection")]
[HttpGet]
public ActionResult<InitializeResponse> InitializeConnection([FromQuery] InitializeRequest request)
{
InitializeResponse result = _connectionProvider.CreateConnection(request.Map()).Map();
return result;
}
[Route("api/XmlALaCarteService/V1/GetDataAsXML")]
[HttpGet("{id}")]
public ActionResult<XmlDocument> GetDataAsXML(DataRequest request)
{
return new XmlDocument();
}
}
If I am not mistaken, other people can connect to my service and perform the actions on it.
We used to have the same service but as an asmx. This asmx came with a WSDL. Is there a way to have the same for my new service?
Solution 1:[1]
To have your .Net Core webapi produce a WSDL/DISCO LIKE definition look at SwaggerUI by SmartBear: Swagger UI.
NuGet Packages: Swashbuckle.AspNetCore.Swagger & Swashbuckle.AspNetCore
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dvdmiami |