Forum Discussion

ravinderreddy's avatar
ravinderreddy
Occasional Contributor
9 years ago
Solved

DeserializationFailed Error when Submitted the SOAP Request

Hi,

Can anyone solve this issue?
When Submitted the SOAP Request there is a Deserialization error "Deserialized object with reference id '?' not found in stream." I am not able to understand why I am getting this exception.When I did the same thing from another tool ,it is working fine .I am able to get the response.

The XML which is generated in SOAP UI contains "<tas:request ser:Id="?" ser:Ref="?">". what are these? What should I pass over here.?

The error details are below

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <s:Fault>
         <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode>
         <faultstring xml:lang="en-GB">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter .The InnerException message was 'Deserialized object with reference id '?' not found in stream.'.  Please see InnerException for more details.</faultstring>
         <detail>
            <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 i:nil="true"/>
                  <Message>Deserialized object with reference id '?' not found in stream.</Message>
                  <StackTrace>at System.Runtime.Serialization.XmlObjectSerializerReadContext.GetExistingObject(String id, Type type, String name, String ns)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.TryHandleNullOrRef(XmlReaderDelegator reader, Type declaredType, String name, String ns, Object&amp; retObj)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract&amp; 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)
   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.PartInfo.ReadObject(XmlDictionaryReader reader, XmlObjectSerializer serializer)
   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 .The InnerException message was 'Deserialized object with reference id '?' not found in stream.'.  Please see InnerException for more details.</Message>
               <StackTrace>at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
               <Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type>
            </ExceptionDetail>
         </detail>
      </s:Fault>
   </s:Body>
</s:Envelope>

 

  • nmrao's avatar
    nmrao
    9 years ago
    In this case, one way would be to connect to the service provide to see why the application showing exception in first place instead of showing right message to end user so that he/she can understand what went wrong.

6 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You mean in the request that it was showing some '?' marks? Try with a valid request and see what is happening on the server side to see why such response coming.
    • ravinderreddy's avatar
      ravinderreddy
      Occasional Contributor

      I am giving the proper input .But the thing is that there is an xml tag <tas:request ser:Id="?" ser:Ref="?"> which consists ser:ID and Ref .Dont know what values I need to pass over here.So I have given ser:Id="0" and removed ser:Ref and now I am getting another error "The value '?' cannot be parsed as the type 'DateTime'."

      at System.Xml.XmlConverter.ToDateTime(String value)    at System.Xml.XmlConverter.ToDateTime(Byte[] buffer, Int32 offset, Int32 count)    at System.Xml.XmlBaseReader.ReadContentAsDateTime()    at System.Xml.XmlDictionaryReader.ReadElementContentAsDateTime()    at ReadOrderPayPalFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )    at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)    at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract&amp; dataContract)    at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)    at ReadOrderPayPalRequestFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )    at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)    at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract&amp; 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)

      There is a tag with CreateDateTime which is not mandatory.So I don't need to give any input for this.When I place the same request thru WCF Storm it is giving the proper response and not giving any parsing error.There is a default value 01:01:0001 00:00:00 in WCF Storm but in SOAP UI there is no default value like this. How can I solve this? When the same thing is working with another then why not with SOAP UI?

      • nmrao's avatar
        nmrao
        Champion Level 3
        In this case, one way would be to connect to the service provide to see why the application showing exception in first place instead of showing right message to end user so that he/she can understand what went wrong.