Answered by:
Plug-ins and third party Webservices

Question
-
hi, im getting a major headace by trying to get a third party webservice working inside a plugin for crm4.0
registering a plugin just takes the *.dll NOT the *.dll.config which is required to run that plugin (initiate the webservice)
ive digged almost 8hours through the web and so on but nothing realy helped me..
is there a way to get the *.dll.config with the plugin or a workaround?
thanksMonday, September 28, 2009 3:27 PM
Answers
-
Hi,
If you need to read a 3rd web service through a configuration, you need write your own class to read from your configuration file with in the plug-in. You can't include the .*dll.config file with in the plug-in.
Here's a suggestion, put your configuration file as xml in your CRM server (you can define your own xml configuration). within your plug-in, using text reader to read the values from that text file.
this is probably the only want to do it. I hope it helps.
Darren Liu | 刘嘉鸿 | MS CRM MVP | English Blog: http://msdynamicscrm-e.blogspot.com | Chinese Blog: http://liudarren.spaces.live.com- Proposed as answer by darrenliuMicrosoft employee, Moderator Monday, September 28, 2009 9:06 PM
- Marked as answer by Donna EdwardsMVP Friday, October 2, 2009 5:04 PM
Monday, September 28, 2009 9:06 PMModerator
All replies
-
You can use the parameters of the plugin constructor to pass your web service url
then, when instanciating the web service, set the Url property with the data back from the constructor
example:
string _webServiceUrl;
public void myPlugin(string secureConfig, string unsecureConfif)
{
_webServiceUrl = secureConfig;
}
public override void Execute(IPluginContext context)
{
MyWebService mws = new MyWebService();
mws.Url = _webServiceUrl;
}
You can define the secure and unsecure config while registering you plugin step...Monday, September 28, 2009 3:53 PMModerator -
Hi,
If you need to read a 3rd web service through a configuration, you need write your own class to read from your configuration file with in the plug-in. You can't include the .*dll.config file with in the plug-in.
Here's a suggestion, put your configuration file as xml in your CRM server (you can define your own xml configuration). within your plug-in, using text reader to read the values from that text file.
this is probably the only want to do it. I hope it helps.
Darren Liu | 刘嘉鸿 | MS CRM MVP | English Blog: http://msdynamicscrm-e.blogspot.com | Chinese Blog: http://liudarren.spaces.live.com- Proposed as answer by darrenliuMicrosoft employee, Moderator Monday, September 28, 2009 9:06 PM
- Marked as answer by Donna EdwardsMVP Friday, October 2, 2009 5:04 PM
Monday, September 28, 2009 9:06 PMModerator -
hi,
well missing experience.. ^^
i ve build a webservice as wrapper around the servicecontract, that solved the problem
the dll of a webservice contains no .config and works pretty nice.Monday, October 5, 2009 3:39 PM