Monthly Archives: December 2014

Using Webservices in Dynamics CRM plug-ins


Sometimes you need calling a web service inside a plugin, like a scenario we encountered. We need a plugin for an activity Status change event, which calls a web service out side of the CRM server. In this situations if you add a web service reference in plug-in code in visual studio and deploying it to CRM server, it would not work using the config items in App.config.

What is the solution ?

You should manually config the web service, I mean hard code it like below :

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress endpoint = new EndpointAddress("http://webservice?wsdl");
var webserviceClient= new WEbServiceClient(binding, endpoint);