2016-04-06 18 views
1

現在、私はcrmプロジェクトに取り組んでいます。このプロジェクトでは、Webサービスにデータを送信し、洗練されたデータを取り戻す必要があります。この操作は、カスタムワークフローで動作する必要がありますが、私はそれをやる方法がわからないのですか?助言がありますか?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クライアント構成セクションで参照契約 'GetCustomerInfoService.ITransactionService' というデフォルトのエンドポイント要素を見つけることができませんでした。これは、アプリケーションに設定ファイルが見つからなかったか、またはこの契約に一致するエンドポイント要素がクライアント要素内に見つからなかった可能性があります。システムでSystem.ServiceModel.ChannelFactory 1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) at System.ServiceModel.ConfigurationEndpointTrait 1.CreateSimplexFactory(AT System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint、ストリングconfigurationName)System.ServiceModel.ChannelFactory.InitializeEndpoint(文字列configurationName、EndpointAddressアドレス)で で ) ライン0 Vrp.Crm.PluginLibrary2013.CustomWorkflowsで:でVrp.Crm.PluginLibrary2013.GetCustomerInfoService.TransactionServiceClient..ctorでSystem.ServiceModel.ClientBase`1.InitializeChannelFactoryRef() で.ServiceModel.ClientBase 1.CreateChannelFactoryRef(EndpointTrait 1 endpointTrait) () .SetCumstomerIdToIncident.Execute(CodeActivityContextコンテキスト):c:\ Veripark \ Projects \ gisik \ DRCRM.VERITOUCH.CRM2013 \ PluginLibrary2013 \ CustomWorkflows \ CheckSubInc identForMainIncident.cs:System.Activities.CodeActivity.InternalExecute(ActivityInstanceインスタンス、ActivityExecutorエグゼキュータ、BookmarkManager bookmarkManager)System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBodyで (ActivityExecutorエグゼキュータ、BookmarkManager bookmarkManager、ロケーションresultLocation)

におけるライン72
+0

設定ファイルが保存されているパスをサービスに送信する必要があります。 – Sxntk

答えて

0

Dynamics CRMを使用していると仮定します。これは概要です。

  1. 実際のWebサービスの呼び出しを行うカスタムワークフローアクティビティを作成します。 https://msdn.microsoft.com/en-us/library/gg328515.aspx
  2. カスタムアクティビティには、Webサービスからの結果を呼び出し元のCRMワークフローに返す出力パラメータが含まれています。
  3. 最後に、カスタムアクティビティを使用するワークフローとそのトリガを作成します。さらに詳しい情報:私は、これはあなたが正しい道を見出し得るために十分な情報であると思います http://crmbook.powerobjects.com/system-administration/processes/workflows/ https://msdn.microsoft.com/en-us/library/gg328264.aspx

+0

はい、私はすでにこれを実際にやろうとしていますが、私はWebサービスに接続できませんか? – Ahmetcan

+0

私は混乱しています。外部WebサービスまたはDynamics CRM Webサービスを参照していますか? –

+0

外部ウェブサービス – Ahmetcan

関連する問題