Integration made easy with web service
(Single Plug & Play Solution to call Different web service (without adding Reference) like SOUP-UI)
CRM integration is a major challenge for organizations of all sizes. All businesses today are focusing more on customer and front office to be able to provide higher value-added services and support to them. The reason for doing so is obvious, as it helps them maximize their ROI, lead to greater customer satisfaction, ensures higher revenue leading to healthy bottom line.
In this article, we are providing an example of how Single Action can be used to make a request to different web services outside of the CRM domain from a record’s form event. For this you would need to provide only the web service URL and required inputs.
In some CRM deployments we need to call multiple web services according to the requirement for different events and there is a possibility that the web service is hosted on an environment other than the CRM Domain. So there is need of Single Plug & Play Solution to call different web services.
To overcome the problems in integration of web services, we can write a Single Action that would be enough to integrate multiple web services with required number of input & outputs.
Here is the process to implement this solution. The steps are really simple to understand and implement.
1. Create an Action of type process. This action would have say 4 input values and 1 output value.
2. The action would need a custom workflow activity which will work as bridge between CRM application and the external web service which could be either in same domain or different domain. This custom workflow will be responsible for fetching the required details by calling the expected web service.
Please refer to the attached dll of the custom workflow which you could use directly in any action to call web service by passing the input parameter only. Please note that you do not need to add any type of web reference of any web service.
This is the last piece of the puzzle. At this point, we simply need to call the action created
from a web resource library on any event ( e.g. Ribbon button click, OnChange of a field value etc.).
To call action from web resource library you need to write a function that is triggered when the expected event occurs at client side.
This function will trigger an action in effect and consume the values returned by action, read the output values and use the same as required.
To call web service in other domain, another solution is needed to deploy intermediate web service in same domain and call this service from CRM web resource library. This approach has its own side effects. E.g. Fluctuating results, Performance issues, maintenance in future in case of additional web methods to be added etc.
With the solution of using actions to call web services in this blog we get benefited in terms of:
1. Plug and Play Solution
2. Improved Performance
3. No Fluctuation in Results
4. Very Less Maintenance
5. One Time Efforts
This post has been written by Pradip Jadhav