Answered by:
New to Blazor, consume soap web service from Blazor

Question
-
User-1482891610 posted
Hi
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
Return DAL.VehicleLog.ReportVehiclesStats()
End Function
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
Sunday, June 21, 2020 5:07 PM
Answers
-
User-474980206 posted
its a feature lost with the .net core. follow this thread:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, June 24, 2020 6:38 PM -
User1019343426 posted
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:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, June 25, 2020 8:56 AM
All replies
-
User-474980206 posted
its a feature lost with the .net core. follow this thread:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, June 24, 2020 6:38 PM -
User1019343426 posted
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:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, June 25, 2020 8:56 AM