通过crm工作流调用Web服务

通过crm工作流调用Web服务,web,plugins,service,workflow,crm,Web,Plugins,Service,Workflow,Crm,目前我正在从事一个crm项目。在这个项目中,我必须将数据发送到web服务,并将经过优化的数据取回。这个操作必须在自定义工作流上进行,但我被卡住了,事实上我不知道怎么做?有什么建议吗 Here is my service code; var tmpIncident = getIncidentById(organizationServiceContext); if (tmpIncident != null) //if we have decent incident we con

目前我正在从事一个crm项目。在这个项目中,我必须将数据发送到web服务,并将经过优化的数据取回。这个操作必须在自定义工作流上进行,但我被卡住了,事实上我不知道怎么做?有什么建议吗

Here is my service code; 


var tmpIncident = getIncidentById(organizationServiceContext);
        if (tmpIncident != null) //if we have decent incident we connect service and proceed the data.
        {
            GetCustomerInfoService.TransactionServiceClient client = new GetCustomerInfoService.TransactionServiceClient();
            GetCustomerInfoService.TransactionRequest request = new GetCustomerInfoService.TransactionRequest();


            #region authentication  
            request.AuthenticationData.UserName = "user";
            request.AuthenticationData.Password = "pass";
            #endregion

            Guid id = Guid.NewGuid(); //create random guid
            request.RequestId = id.ToString();
            request.OrderNumber = tmpIncident.vrp_ordernumber;

            GetCustomerInfoService.TransactionResponse response = client.GetTransactionByOrderNumber(request);
            tmpIncident.CustomerId = new EntityReference("Contact", new Guid(response.Message));


            this.updateChanges(organizationServiceContext, tmpIncident);

            client.Close();
        } 
当我测试插件时,我收到了那个错误

错误消息:

未处理的异常:System.InvalidOperationException:在ServiceModel客户端配置节中找不到引用约定“GetCustomerInfo.ITransactionService”的默认终结点元素。这可能是因为找不到应用程序的配置文件,或者在客户端元素中找不到与此约定匹配的端点元素。 位于System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint ServiceEndpoint,String configurationName) 位于System.ServiceModel.ChannelFactory.InitializeEndpoint(字符串配置名称,端点地址) 位于System.ServiceModel.ChannelFactory
1..ctor(字符串endpointConfigurationName,EndpointAddress remoteAddress)
位于System.ServiceModel.ConfigurationEndpointTrait
1.CreateSimplexFactory() 位于System.ServiceModel.ClientBase
1.CreateChannelFactoryRef(EndpointTrait
1 EndpointTrait) 在System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()处 第0行中的Vrp.Crm.PluginLibrary2013.GetCustomerInfo.TransactionServiceClient..ctor()处 在c:\Veripark\Projects\gisik\DRCRM.VERITOUCH.CRM2013\PluginLibrary2013\CustomWorkflows\CheckSubIncidentForMainIncident.cs中的Vrp.Crm.PluginLibrary2013.CustomWorkflows.SetCumstomerIdToIncident.Execute(CodeActivityContext上下文):第72行 位于System.Activities.CodeActivity.InternalExecute(ActivityInstance实例、ActivityExecutor执行器、BookmarkManager书签管理器)
在System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,BookmarkManager BookmarkManager,Location resultLocation)

中,假设您使用的是Dynamics CRM。这是一个高层次的概述:

  • 创建一个自定义工作流活动,以实际调用Web服务。这将帮助您开始:
  • 自定义活动将具有输出参数,这些参数将从webservice返回结果到调用CRM工作流
  • 最后,创建将使用自定义活动的工作流及其触发器。更多信息:

  • 我希望这些信息足以让您走上正确的道路。

    假设您使用的是Dynamics CRM。这是一个高层次的概述:

  • 创建一个自定义工作流活动,以实际调用Web服务。这将帮助您开始:
  • 自定义活动将具有输出参数,这些参数将从webservice返回结果到调用CRM工作流
  • 最后,创建将使用自定义活动的工作流及其触发器。更多信息:

  • 我希望这些信息足以让您走上正确的道路。

    是的,我已经在尝试这样做了。事实上,我无法连接web服务?我很困惑,您是指外部web服务还是Dynamics CRM web服务?外部web服务您尝试了什么?你收到了什么错误?我的建议是,在一个简单的控制台应用程序中测试您的web服务调用,确保一切正常,然后将其移动到自定义活动。是的,我已经在尝试这样做了,事实上,我无法连接web服务?我很困惑,您指的是外部web服务还是Dynamics CRM web服务?外部web服务您尝试了什么?你收到了什么错误?我建议您在一个简单的控制台应用程序中测试web服务调用,以确保一切正常,然后将其移动到自定义活动。您需要向服务发送保存配置文件的路径。您需要向服务发送保存配置文件的路径。