Hi Tim, I have a test case with the code: My expectation setting for the call is like below. Expect.On(MTInterface).Call(MTInterface.TestMethod(0, null, null, out ResultDataset, out ErrorMsg)).OutRef(ResultDataset).Return(0).IgnoreArguments().Constraints(Is.Equal(52), Is.Anything(), Is.Anything(), Is.Anything(), Is.Anything());
Test code makes the following call: resultCode = MTInterface.TestMethod(52, m_MethodParam, /*Properly populated int[] */m_securityArguments.SecurityIds, out DataSetResult, out errorMsg); A call to the above method fails with the mentioned exception. Am I missing something here..? Regards, Prabu On Mon, Jan 4, 2010 at 9:54 PM, Tim Barcz <[email protected]> wrote: > Can you provide a failing test that I (we) can run? > > On Mon, Jan 4, 2010 at 7:32 AM, Prabu <[email protected]> wrote: > >> Hi, >> I am using Rhino mocks 3.5 for mocking our web service. I am using a >> PartialMock and the mock works fine for other methods but fails for a >> method which has int[] as an argument. On changing the argument to int >> this works fine. >> >> int TestMethod(int MethodIndex, IDValuePair[] MethodArguments, int[] >> SecurityIds, out System.Data.DataSet ResultData, out string ErrorMsg); >> >> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/ >> System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema- >> instance"><HelpLink i:nil="true" /><InnerException><HelpLink >> i:nil="true" /><InnerException><HelpLink i:nil="true" / >> ><InnerException i:nil="true" /><Message>End element 'SecurityIds' >> from namespace 'http://webservice.test.com/test' expected. Found >> element 'int' from namespace 'http://webservice.test.com/test'. Line >> 1, position 453.</Message><StackTrace> at >> System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader >> reader, String res, String arg1, String arg2, String arg3) >> at System.Xml.XmlExceptionHelper.ThrowEndElementExpected >> (XmlDictionaryReader reader, String localName, String ns) >> at System.Xml.XmlBaseReader.ReadEndElement() >> at System.Runtime.Serialization.XmlReaderDelegator.ReadEndElement() >> at System.Runtime.Serialization.CollectionDataContract.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, 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) >> at >> >> System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions >> (XmlReaderDelegator reader, Boolean verifyObjectName)</ >> StackTrace><Type>System.Xml.XmlException</Type></ >> InnerException><Message>There was an error deserializing the object of >> type System.Int32[]. End element 'SecurityIds' from namespace 'http:// >> webservice.test.com/test' expected. Found element 'int' from namespace >> 'http://webservice.test.com/test'. Line 1, position 453.</ >> Message><StackTrace> at >> >> System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions >> (XmlReaderDelegator reader, Boolean verifyObjectName) >> at System.Runtime.Serialization.DataContractSerializer.ReadObject >> (XmlDictionaryReader reader, Boolean verifyObjectName) >> at >> >> System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart >> (XmlDictionaryReader reader, PartInfo part, Boolean isRequest)</ >> StackTrace><Type>System.Runtime.Serialization.SerializationException</ >> Type></InnerException><Message>The formatter threw an exception while >> trying to deserialize the message: There was an error while trying to >> deserialize parameter http://webservice.test.com/test:SecurityIds. The >> InnerException message was 'There was an error deserializing the >> object of type System.Int32[]. End element 'SecurityIds' from >> namespace 'http://webservice.test.com/test' expected. Found element >> 'int' from namespace 'http://webservice.test.com/test'. Line 1, >> position 453.'. Please see InnerException for more details.</ >> Message><StackTrace> >> >> Thanks, >> Prabu >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Rhino.Mocks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<rhinomocks%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/rhinomocks?hl=en. >> >> >> > > > -- > Tim Barcz > Microsoft C# MVP > Microsoft ASPInsider > http://timbarcz.devlicio.us > http://www.twitter.com/timbarcz > > -- > You received this message because you are subscribed to the Google Groups > "Rhino.Mocks" group. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rhinomocks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.
