Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Deserializing message sent by CRM to Azure Service Bus

$
0
0

Hello everyone,

First of all, i don't know if this post should belong to this forum or the Service Bus one, so forgive me if it's the wrong one ...

My issue is the following :

* I configure the CRM via the Plugin registration tool to send ".NetBinary" message to our Service Bus on Azure (it's configured like this since 6 months).

* I have an application which receive these messages and use the following code to "decrypt" it into a IPluginExecutionContext object :

var stream = message.GetBody<Stream>();
DataContractSerializer serializer = new DataContractSerializer(typeof(RemoteExecutionContext));
XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max);
var deserializedBody = serializer.ReadObject(reader);
IPluginExecutionContext plugin = (IPluginExecutionContext)deserializedBody;


My problem is :
* Sometimes a regular opportunity update is handled properly (most of the times)
* Sometimes i get an exception raised : "There was an error deserializing the object of type Microsoft.Xrm.Sdk.RemoteExecutionContext. The input source is not correctly formatted."

I don't really know what is happening, is it an issue of the CRM side when it sends the message to SB ? Is it an error of my console app.

Thanks a lot in advance,

Clément


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images