question

AkshayChhangani-1971 avatar image
0 Votes"
AkshayChhangani-1971 asked

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

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.

dotnet-runtimeazure-api-managementwindows-wcf
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers