How to correctly use soap webservice client in c#

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to correctly use soap webservice client in c#



I am new to c# and trying to consume a SOAP web service, i generated a service reference to the WSDL and am able to do the following to retrieve a DataSet of the response.


SportingGatewaySoapClient myServices = new SportingGatewaySoapClient("GatewaySoapID");

RSportResults sportsResults = myServices.SportResults("username","password");
System.Data.DataSet dataSet = sportsResults.dsSportResults;



I am able to see the correct information if I iterate through the dataset like you would normally :


foreach (DataTable table in dataSet.Tables)
{
foreach (DataRow row in table.Rows)
{
foreach (object item in row.ItemArray)
{
Console.WriteLine(item);
}
}
}



But I am failing to see how I can Unmarshall the data directly into the generated classes so I can reference its properties by name. eg :


// some code here to convert response to a Sport object
sport.getSportName()



The auto generated Reference.cs file has classes like this :


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="https://endpointurl")]
public partial class RSport : object, System.ComponentModel.INotifyPropertyChanged {

private string sportName;



What step am I missing here?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

Future solutions