public object Deserialize(Stream serializationStream, HeaderHandler handler)
 {
     if (serializationStream == null)
     {
         throw new ArgumentNullException("serializationStream");
     }
     if (serializationStream.CanSeek && (serializationStream.Length == 0L))
     {
         throw new SerializationException(SoapUtil.GetResourceString("Serialization_Stream"));
     }
     InternalFE formatterEnums = new InternalFE {
         FEtypeFormat = this.m_typeFormat,
         FEtopObject = this.m_topObject,
         FEserializerTypeEnum = InternalSerializerTypeE.Soap,
         FEassemblyFormat = this.m_assemblyFormat,
         FEsecurityLevel = this.m_securityLevel
     };
     ObjectReader objectReader = new ObjectReader(serializationStream, this.m_surrogates, this.m_context, formatterEnums, this.m_binder);
     if ((this.soapParser == null) || (serializationStream != this.currentStream))
     {
         this.soapParser = new SoapParser(serializationStream);
         this.currentStream = serializationStream;
     }
     this.soapParser.Init(objectReader);
     return objectReader.Deserialize(handler, this.soapParser);
 }
 internal void Init(ObjectReader objectReader)
 {
     this.objectReader = objectReader;
     this.soapHandler.Init(objectReader);
     this.bStop = false;
     this.depth = 0;
     this.xmlReader.ResetState();
 }
Esempio n. 3
0
        internal void Init(ObjectReader objectReader)

        {
            InternalST.Soap( this, "Init");     
            this.objectReader = objectReader;
            soapHandler.Init(objectReader);
            bStop = false;
            depth = 0;
            xmlReader.ResetState();
        }
 internal Assembly GetAssembly(ObjectReader objectReader)
 {
     if (this.assembly == null)
     {
         this.assembly = objectReader.LoadAssemblyFromString(this.assemblyString);
         if (this.assembly == null)
         {
             throw new SerializationException(string.Format(CultureInfo.CurrentCulture, SoapUtil.GetResourceString("Serialization_AssemblyString"), new object[] { this.assemblyString }));
         }
     }
     return this.assembly;
 }
Esempio n. 5
0
		internal Assembly GetAssembly(ObjectReader objectReader)
		{
			if (assembly == null)
			{
				assembly = objectReader.LoadAssemblyFromString(assemblyString);
				if (assembly == null)
					throw new SerializationException(String.Format(SoapUtil.GetResourceString("Serialization_AssemblyString"),assemblyString));
			}
			return assembly;
		}
Esempio n. 6
0
        internal void Init(ObjectReader objectReader)
        {
            this.objectReader = objectReader;
            objectReader.soapHandler = this;
            isEnvelope = false;
            isBody = false;
            isTopFound = false;
            attributeValues.Clear();
            assemKeyToAssemblyTable = new Hashtable(10);
            assemKeyToAssemblyTable[urtKey] = new SoapAssemblyInfo(SoapUtil.urtAssemblyString, SoapUtil.urtAssembly);
            assemKeyToNameSpaceTable = new Hashtable(10);
            assemKeyToInteropAssemblyTable = new Hashtable(10);
            nameSpaceToKey = new Hashtable(5);
            keyToNamespaceTable = new Hashtable(10);

        }
    	// Deserialize the stream into an object graph.
		public Object Deserialize(Stream serializationStream, HeaderHandler handler) {
			InternalST.InfoSoap("Enter SoapFormatter.Deserialize ");			
            if (serializationStream==null) {
                throw new ArgumentNullException("serializationStream");
            }

			if (serializationStream.CanSeek && (serializationStream.Length == 0))
				throw new SerializationException(SoapUtil.GetResourceString("Serialization_Stream"));								

			InternalST.Soap( this, "Deserialize Entry");
			InternalFE formatterEnums = new InternalFE();
			formatterEnums.FEtypeFormat = m_typeFormat;
			formatterEnums.FEtopObject = m_topObject;
			formatterEnums.FEserializerTypeEnum = InternalSerializerTypeE.Soap;
			formatterEnums.FEassemblyFormat = m_assemblyFormat;
			formatterEnums.FEsecurityLevel = m_securityLevel;              
			ObjectReader sor = new ObjectReader(serializationStream, m_surrogates, m_context, formatterEnums, m_binder);

			// If this is the first call, or a new stream is being used a new Soap parser is created.
			// If this is a continuing call, then the existing SoapParser is used.
			// One stream can contains multiple Soap XML documents. The XMLParser buffers the XML so
			// that the same XMLParser has to be used to continue a stream.
			if ((soapParser == null) || (serializationStream != currentStream))
			{
				soapParser = new SoapParser(serializationStream);
				currentStream = serializationStream;
			}
			soapParser.Init(sor);
			Object obj = sor.Deserialize(handler, soapParser);
			InternalST.InfoSoap("Leave SoapFormatter.Deserialize ");
			return obj;
		}