Last post Jun 25, 2020 08:56 AM by zoran123456
Jun 21, 2020 05:07 PM|BigMeat|LINK
I am trying to learn Blazor having done Web Forms for many years. So I appologise if my question is somehwhat basic.
I have a web service in an old web forms app, I am exposing the Data Access Layer via a asmx web service using the below
<WebMethod(MessageName:="Get Stats", Description:="Get stats on all vehicles")>
Public Function GetVehiclesStats() As Dataset
I am then trying to consume the web service from my Blazor app, I have added the service to my Connected Services, naming it wsRW. I can call the web service fine to bring back a string value (hello world). But when I try and call the dataset it seems to
think its an ArrayOfXElement rather than a dataset. My code is below:
wsRW.wsRoadwatchSoapClient ws = new wsRW.wsRoadwatchSoapClient(wsRW.wsRoadwatchSoapClient.EndpointConfiguration.wsRoadwatchSoap);
wsRW.ArrayOfXElement a = ws.GetVehiclesStats(); //This works but is not a dataset
System.Data.DataSet ds = ws.GetVehiclesStats(); //This fails
Any idea how I can solve this issue.
Many thanks in advance
Jun 24, 2020 06:38 PM|bruce (sqlwork.com)|LINK
its a feature lost with the .net core. follow this thread:
Jun 25, 2020 08:56 AM|zoran123456|LINK
Yeah, SOAP web services are no longer a thing and therefore not available with cross platform .NET Core (they are available in .NET Framework), you will need to either migrate existing ASMX to WebApi or make some sort of abstraction, like add new WebApi
endpoints to existing SOAP project (they can work together just fine), consume ASMX there (in your WebApi endpoint), transform it to JSON, and return it as a result.
More info about adding Web Api to WebForms project: