How to integrate with a 3rd party system which requires a login
It is possible to integrate with 3rd party systems, which require an explicit login.
Note: the "Cookie-Handling" functionality described below requires service pack 2 of CRM.interface.
In order to set up the integration with such a system you only need to add a second instance of RestApi activity to your integration workflow. The first instance of RestApi activity is responsible for making the "Login" into the 3rd party system and retrieving the cookies. The second activity instance is responsible for exchanging the data between the integration hub and the 3rd party endpoint.
Note: For the communication with SOAP endpoints the workflow now supports a new property
Cookies. If the response header contains a Set-Cookie entry, its value
is assigned to the Cookies property of the activity. In order to share the cookie
between multiple activity instances, a workflow variable is used and assigned to the
property of each instance. This way the first call to the 3rd party service fills the
variable with the value from the response and each consecutive RestApi instance sends it
along with the request.
Note: For non-SOAP communications the property HttpClient is used to store the
cookie. When this property is assigned to an instance of the HttpClient object
with CookieContainer, it is used to make the call to the 3rd party system. If this
instance of HttpClient is shared in similar fashion as described above (workflow variable
passed to each RestApi instance), cookies retrieved from the first call to the 3rd party
service is resent with every subsequent request.