Azure APIM - SOAP to REST Import : Deserialization not working as expected after import

Akshay Chhangani 1 Reputation point
2021-10-22T14:38:51.553+00:00

Hi Team,

I have some WCF services in .Net Framework v4.8 which I imported to Azure APIM service using the manual import provided on azure portal. I used the SOAP to REST import option to do the same (which worked fine with the single WSDL representation of my WCF service).
Although, I encountered some issues while testing that through portal regarding Deserialization of objects. Below is the list of issues I encountered, Please help out or point in the correct directions as applicable:

  1. The properties that are not nullable and also not required in the request throws error as this -
    The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter xyz. The InnerException message was 'ValueType 'System.Boolean' cannot be null.'. Please see InnerException for more details
    This is caused due to the inbound policies, which add an empty tag for the property not provided and which is not required too.
  2. Deserializing the Enums also gives error like this -
    The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter xyz. The InnerException message was 'Invalid enum value '1' cannot be deserialized into type 'XYZ'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'. Please see InnerException for more details.
    Already has the required attributes stated in the error.
  3. Error in the DateTime type properties too - seems like the APIM gateway deserializes the date in the DateTime format before making the SOAP request, below is the error -
    The value '10/22/2021 5:20:47 AM' cannot be parsed as the type 'DateTime'.

Could anyone help me here? If these are already known issues or fixed, please guide me in the right direction.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,768 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,395 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,125 questions
{count} votes