Hi there! We are developing an application and want to add a custom channel provider. We follow this guide and stuck on 7. Implement message sending step.
The question in the send messages logic though Creatio interface.
Let's assume we already have an active chat with some contact and messages from the contact. If we send (outcoming) message to the chat, we will only see a modal window with "Error while sending the message" message.
We checked the request made when sending the message. The request URL is .../0/rest/OmnichannelOutcomeMessagingService/SendMessage, and the payload:
{
"message": {
"Attachments": null,
"ChannelId": "e79043bc-377d-46b9-86ee-9b0fc4845f0b",
"ChatId": "f2374931-2402-411a-bf37-0eb2a6acd422",
"ContactIdentification": null,
"Id": "00000000-0000-0000-0000-000000000000",
"IsEcho": false,
"IsGuestUser": false,
"IsStandBy": false,
"Message": "test",
"MessageDirection": 2,
"MessageType": 0,
"Recipient": "Test User",
"Sender": "123",
"Source": 2,
"Timestamp": 0
}
}
We also have an IOutcomeMessageWorker interface implementation binded with our "Test" channel (which has Source set to "123" as you can notice from the payload).
We tried to call the OmnichannelMessagingService.InternalSend method with the same MessagingMessage and saw the following stack trace:
The server encountered an error processing the request. The exception message is 'Error creating an instance
of the "OmnichannelProviders.MessageWorkers.IOutcomeMessageWorker" class'. See server logs for more details.
The exception stack trace is:
at Terrasoft.Core.Factories.ClassFactory.GetInstance[T](Func`1 action)
at OmnichannelMessaging.MessageWorkerFactory`1.GetWorkerInstance(String messengerName)
at OmnichannelMessaging.MessageOutcomeWorker.InternalSend(UnifiedMessage message, String messenger)
at Terrasoft.Configuration.Omnichannel.Messaging.OmnichannelMessagingService.InternalSend(MessagingMessage
messagingMessage)
at Terrasoft.Configuration.Omnichannel.Messaging.CusboOmnichannelMessagingService.test()
at Terrasoft.Configuration.CusboMessageEventsHandlerWebServiceNamespace.CusboEventHandlerWebService.test()
at SyncInvoketest(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&
outputs)
at Terrasoft.Web.Common.ServiceModel.ThreadContextInitializer.Invoke(Object instance, Object[] inputs,
Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
If we add MessagingMessage.Channel = "Test", the message is sent successfully. So we wonder if we are missing something in our configuration and how to send the message to the custom channel provider. Or if there is a way to call custom logic (endpoint, service, anything) when sending messages to custom channel provider.
Thanks in advance.