How to use WebClient to call remote wabservice from C# Bpmonline class?

How to use WebClient to call remote webservice from C# Bpmonline class?



When we code that :



            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri(UrlMiddleware);

            client.DefaultRequestHeaders.Accept.Clear();

            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            HttpResponseMessage response = client.GetAsync("api/customers").Result;


Bpm online can't "publish" because it send that error:

The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)

but i have added using's:

    using System.Net.Http;
    using System.Net.Http.Headers;

Have you a idea please?

Davyd
Like 1

Like

3 comments

Hi David, I was also having the same issue and didn't get a resolution. I went ahead and completed my integration with HttpWebRequest class instead of http class.

Ok! Very thanks, i'm going to use directly the HttpWebRequest  class ...

 

Dear Davyd, 



The assembly System.Net.Http.dll is missing in the business process class. Please consider downloading the library and adding it in the "External Assemblies" tab in the configuration.



Image.png



You can download the library from public sources. For example

https://www.dllme.com/dll/files/system_net_http_dll.html



Additionally, please find more information about references in the post by the link below.

https://stackoverflow.com/questions/9611316/system-net-http-missing-fro…



Additionally, please remove the System.Net.Http.HttpClient using. 

Show all comments