1923578758
private string ConstructSoapRequest(string a, string b) { return String.Format(@"<?xml version=""1.0"" encoding=""utf-8""?> <s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""> <s:Body> <Add xmlns=""http://CalculatorService/""> <a>{0}</a> {1} </Add> </s:Body> </s:Envelope>", a, b); } private async void GetMakani() { var soapString = this.ConstructSoapRequest(EntryMakaniNumber.Text, ""); string url = "https://www.makani.ae/MakaniPublicDataService/MakaniPublic.svc?singleWsdl"; using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("SOAPAction", url); var content = new StringContent(soapString, Encoding.UTF8, "text/xml"); using (var response = await client.PostAsync("https://www.makani.ae/MakaniPublicDataService/MakaniPublic.svc?singleWsdl", content)) { var soapResponse = await response.Content.ReadAsStringAsync(); System.Diagnostics.Debug.WriteLine("MAKANI RESPONSE"); System.Diagnostics.Debug.WriteLine("---------------"); System.Diagnostics.Debug.WriteLine(soapResponse); System.Diagnostics.Debug.WriteLine("---------------"); System.Diagnostics.Debug.WriteLine("MAKANI RESPONSE"); } } LabelLatitude.Text = "Latitude: "; LabelLongitude.Text = "Longitude: "; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)