Contributions
Re: SoapUI isn't serializing nullable int
Here is my request : <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:quer="http://wowway.com/Care/Query"> <soapenv:Header/> <soapenv:Body> <com: SearchAddress> <!--Optional:--> <com:addressSearchRequest> <!--Optional:--> <com: Address1>Test</com:Address1> <com: State/> <!--Optional:--> <com: Zip/> <!--Optional:--> <com: UserName>Test</com:UserName> </com: addressSearchRequest> </com: SearchAddress> </soapenv:Body> </soapenv:Envelope> I have validation , but this error is thrown instantly from SoapUI, so I can't even debug it. If I validate the request in SoapUI , I'm getting error message saying "Invalid decimal value: expected at least one digit" . Thanks.2.6KViews0likes3CommentsSoapUI isn't serializing nullable int
I have datacontractwith datamember of type nullable int. [DataMember(Order = 5,EmitDefaultValue = false)] public int? Zip { get; set; } When I leave the Zip value empty and submit the request trough SoapUI I'm getting this error : <InnerException i:nil="true"/> <Message>Input string was not in a correct format.</Message> <StackTrace>at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Xml.XmlConvert.ToInt32(String s) at System.Xml.XmlConverter.ToInt32(String value)</StackTrace> <Type>System.FormatException</Type> </InnerException> <Message>The value '' cannot be parsed as the type 'Int32'.</Message> <StackTrace>at System.Xml.XmlConverter.ToInt32(String value) at System.Xml.XmlDictionaryReader.ReadElementContentAsInt() at System.Runtime.Serialization.XmlReaderDelegator.ReadElementContentAsInt() at ReadAddressSearchRequestFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)</StackTrace> <Type>System.Xml.XmlException</Type> </InnerException> When I run this through .net client , the request is serialized correctly and I'm getting good response. Any ideas why I have this problem in SoapUI? Thanks.2.7KViews0likes5Comments