CRM Dynamics 2015插件注册工具在WCF/ASMX服务调用时崩溃
非常感谢您的帮助,我已经在CRM Dynamics 2015中注册了一个电话呼叫插件,当我使用探查器调试插件时,只要我调用WCF服务客户端方法,插件注册工具就会停止工作。我尝试过ASXM服务和WCF服务,我在IIS中的CRM托管的同一台服务器上部署了该服务,我在控制台和SOAP UI上测试了该服务,一切正常,当我在插件上下文中使用它时,它在服务调用时崩溃了注册工具。插件注册工具日志文件中没有记录错误,下面是我的插件代码CRM Dynamics 2015插件注册工具在WCF/ASMX服务调用时崩溃,wcf,dynamics-crm-2015,Wcf,Dynamics Crm 2015,非常感谢您的帮助,我已经在CRM Dynamics 2015中注册了一个电话呼叫插件,当我使用探查器调试插件时,只要我调用WCF服务客户端方法,插件注册工具就会停止工作。我尝试过ASXM服务和WCF服务,我在IIS中的CRM托管的同一台服务器上部署了该服务,我在控制台和SOAP UI上测试了该服务,一切正常,当我在插件上下文中使用它时,它在服务调用时崩溃了注册工具。插件注册工具日志文件中没有记录错误,下面是我的插件代码 public void Execute(IServiceProvider
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()
提前感谢。根据我的经验,插件注册工具不适合调试web服务调用。尝试使用跟踪服务来识别错误或分析web服务响应
ITracingService tracingService =
(ITracingService)serviceProvider.GetService(typeof(ITracingService));
插件注册为隔离“无”(沙盒外)?我相信您的问题与您使用IP地址而不是FQDN有关。再次检查这篇文章-谢谢-这显示了我的错误是由于401未经授权。