我将非常感谢您的帮助,我已经在CRM Dynamics 2015中创建了一个电话插件创建工具,当我使用Profiler调试插件时,插件只要我调用WCF服务客户端方法,注册工具就会停止工作。我已经尝试过使用ASXM服务和WCF服务,我已经在同一台服务器上部署了IIS服务,托管了CRM,我使用控制台和SOAP UI对服务进行了测试,一切正常,我使用它的一分钟插件上下文使服务调用中的注册工具崩溃。没有记录在插件注册工具日志文件中的错误,这里是低于CRM Dynamics 2015插件注册工具在WCF/ASMX服务调用中崩溃
public void Execute(IServiceProvider serviceProvider)
{
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
if (context == null)
{
throw new ArgumentNullException("localContext");
}
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.InitiatingUserId);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
Entity phoneCallEntity = (Entity)context.InputParameters["Target"];
if (phoneCallEntity.LogicalName != "phonecall")
return;
//ensure that the Plugin fires on a create operaton
if (context.MessageName == "Create")
{
try
{
BasicHttpBinding myBinding = new BasicHttpBinding();
myBinding.Name = "BasicHttpBinding_IService1";
myBinding.Security.Mode = BasicHttpSecurityMode.None;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
EndpointAddress endPointAddress = new EndpointAddress("http://154.66.196.127/Webservice/ZoiperCallHistory.asmx");
ZoiperCallHistorySoapClient client = new ZoiperCallHistorySoapClient(myBinding,endPointAddress);
client.Open();
CallHistory callHistory = client.GetZoiperCallHistory();
client.GetZoiperCallHistory();
代码在这一行失败我的插件代码:CallHistory callHistory = client.GetZoiperCallHistory)(;
在此先感谢。
该插件注册为隔离“无”(沙箱外)? –
我相信你的问题与你使用IP地址而不是FQDN有关。重新检查这篇文章 - https://msdn.microsoft.com/en-us/library/gg334752.aspx?f=255&MSPPError=-2147217396 –