New to Blazor, consume soap web service from Blazor RRS feed

  • Question

  • User-1482891610 posted

    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


All replies