Access 3rd web services from c++ MFC

Hi,

I need to access our developed web services from PW explorer.

I took example project from SDK library -  docprop. I would like to have a possibility have a button which connect to my web services and get some information from there.

In C# i use code like this, but can't find how to make run it on C++ with MFC.

The other option is create command in C# for PW explorer, but i do not know how to this as well.

Thanks

Darius

using (var client = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }))
{
client.BaseAddress = new Uri(sDomain);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(scheme, pass);
String sApiPath = "/master-tables";
HttpResponseMessage response = client.GetAsync(sApiPath).Result;
response.EnsureSuccessStatusCode();
string result = response.Content.ReadAsStringAsync().Result;
List<MasterTable> prTables = JsonConvert.DeserializeObject<List<MasterTable>>(result);

foreach (MasterTable t in prTables)
{
if (t.name.Contains(tablename) == true)
{
String sApiPathTr = "/master-tables/" + t.masterTableId + "/records";
HttpResponseMessage responseTr = client.GetAsync(sApiPathTr).Result;
responseTr.EnsureSuccessStatusCode();
string resultTr = responseTr.Content.ReadAsStringAsync().Result;
ReadMasterTableFromCodes = JsonConvert.DeserializeObject<List<TableRecord>>(resultTr);
break;
}
}
}

Parents Reply Children
No Data