Derzeit arbeite ich an einem CRM-Projekt. In diesem Projekt muss ich Daten an den Web-Service senden und verfeinerte Daten zurückholen. Diese Operation muss an einem benutzerdefinierten Workflow arbeiten, aber ich stecke fest, ich habe keine Ahnung, wie es geht. Irgendwelche Vorschläge?Rufen Sie Web-Service über CRM-Workflow
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();
}
Wenn ich Plugin getestet habe, habe ich diesen Fehler erhalten;
Fehlermeldung:
Unbehandelte Ausnahme: System.InvalidOperationException: Kann nicht Standard Endpunktelement finden, den Vertrag 'GetCustomerInfoService.ITransactionService' im Servicemodel-Client-Konfiguration Abschnitt verweist. Dies liegt möglicherweise daran, dass keine Konfigurationsdatei für Ihre Anwendung gefunden wurde oder dass kein Endpunktelement gefunden wurde, das diesem Vertrag entspricht. bei System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors (ServiceEndpoint ServiceEndpoint, String Configuration) bei System.ServiceModel.ChannelFactory.InitializeEndpoint (String Configuration, EndpointAddress Adresse) bei System.ServiceModel.ChannelFactory 1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) at System.ServiceModel.ConfigurationEndpointTrait
1.CreateSimplexFactory() bei System .ServiceModel.ClientBase 1.CreateChannelFactoryRef(EndpointTrait
1 endpointTrait) bei System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef() bei Vrp.Crm.PluginLibrary2013.GetCustomerInfoService.TransactionServiceClient..ctor() in: Zeile 0 bei Vrp.Crm.PluginLibrary2013.CustomWorkflows .SetCumstomerIdToIncident.Execute (CodeActivityContext-Kontext) in c: \ Veripark \ Projekte \ gisik \ DRCRM.VERITOUCH.CRM2013 \ PluginLibrary2013 \ CustomWorkflows \ CheckSubInc identForMainIncident.cs: Leitung 72 bei System.Activities.CodeActivity.InternalExecute (ActivityInstance Beispiel ActivityExecutor Vollstrecker, Bookmarkbookmark) bei System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody (ActivityExecutor Vollstrecker, Bookmarkbookmark, Location resultLocation)
Sie müssen an den Dienst den Pfad senden, in dem die Konfigurationsdatei gespeichert wird. – Sxntk