PowerPlatform-DataverseServiceClient
PowerPlatform-DataverseServiceClient copied to clipboard
Deserialization error when executing PublishAllXmlAsyncRequest
I'm using the PowerPlatform.Dataverse.Client v1.0.9 on .NET v4.8.
When trying to call the new PublishAllXmlAsyncRequest, I'm getting a deserialization error.
Code:
ServiceClient client = new ServiceClient(connectionString); var req = new PublishAllXmlAsyncRequest { RequestId = Guid.NewGuid() }; PublishAllXmlAsyncResponse publishResponse = (PublishAllXmlAsyncResponse)client.Execute(req); Console.WriteLine("Waiting for PublishAll async job to complete");
Error: System.ServiceModel.ProtocolException: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException message was 'Error in line 1 position 711. Element 'http://schemas.microsoft.com/xrm/2011/Contracts/Services:request' contains data from a type that maps to the name 'http://schemas.microsoft.com/crm/2011/Contracts:PublishAllXmlAsyncRequest'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'PublishAllXmlAsyncRequest' and namespace 'http://schemas.microsoft.com/crm/2011/Contracts'.'. Please see InnerException for more details.\r\n\r\nServer stack trace: \r\n at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConve rter faultConverter)\r\n at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.Execute(OrganizationRequest request)\r\n
fyi, same error when using the CrmServiceClient of CrmSdk/XrmTooling. Seems both SDKs have the same issue with this new request.
That SDK message is very new, Please check DVSvcClient 1.0.23, I believe it should be included there.
for the CrmServiceClient, Update the Microsoft.crmsdk.coreassemblies to the current release.
@Chielus This appears to be a bug with the message format in the dataverse server definition, the owning team is looking into it currently. In the mean time, Please try this: var req = new OrganizationRequest("PublishAllXmlAsync"); var resp = client.Execute(req);
let me know if that unblocks you for now.
Folks, The fix for this should have rolled out to all regions at this point, Please reopen if your still experiencing an issue.
thanks !