PowerPlatform-DataverseServiceClient icon indicating copy to clipboard operation
PowerPlatform-DataverseServiceClient copied to clipboard

Deserialization error when executing PublishAllXmlAsyncRequest

Open Chielus opened this issue 3 years ago • 2 comments

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

Chielus avatar Oct 10 '22 19:10 Chielus

fyi, same error when using the CrmServiceClient of CrmSdk/XrmTooling. Seems both SDKs have the same issue with this new request.

Chielus avatar Oct 10 '22 19:10 Chielus

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.

MattB-msft avatar Oct 11 '22 01:10 MattB-msft

@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.

MattB-msft avatar Oct 21 '22 15:10 MattB-msft

Folks, The fix for this should have rolled out to all regions at this point, Please reopen if your still experiencing an issue.

thanks !

MattB-msft avatar Jan 25 '23 15:01 MattB-msft