Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Using HttpClient in custom workflow activity throws System.Security.SecurityException

$
0
0

Hi!

I'm new to CRM development and I'm facing an issue:

I'm writing a custom workflow activity (class derived from CodeActivity) which is supposed to send HTTP requests and posts to REST-interface of another system and deserialize XML-content.
The custom code is called during a dialog-workflow. I'm using URLs and not IP-addresses in the code.
For this purpose, I'm using the HttpClient -class to send requests, however execution of the line
return client.PostAsync(uri, content).Result;

throws System.Security.SecurityException.

"client" is an HttpClient-object.

The code itself is used in other programs successfully and this is a new issue.

Is the reason behind this the asynchronous nature of the post operation or something else?
Is there a workaround for this, or should I use synchronous methods of some other Http-class?

I'm using Dynamics Online and I'm aware that sandboxed plugins have some limtiations but detailed answers are much appreciated since I'm trying to understand the system I'm working with.


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>