views:

125

answers:

1

a:DeserializationFailed The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:alert. The InnerException message was 'There was an error deserializing the object of type PerformanceManagement.BusinessObjects.Alert. The value '' cannot be parsed as the type 'Int32'.'. Please see InnerException for more details.

Hi i am getting this resopnce, when i am passing null value to int parameter in service. I am using wcf service.If input type is string then it is working fine if it is int then it is displaying above soapui exception.

Please help me to resolve this issue. Thanks in advance

A: 

The error you're getting is because Int32 is a value type so it cannot be null and that's why the deserialization fails. What you can do is to either change the type to string (which works as you said) or change that particular Int32 property to optional in your data contract. This way you don't have to pass anything in. Hope that helps.

Jarin