Dump() private method

private Dump ( String value ) : void
value String
return void
Esempio n. 1
0
		//internal void WriteItemObjectRef(int idRef)
		internal void WriteItemObjectRef(NameInfo itemNameInfo, int arrayId)
		{
			itemNameInfo.Dump("WriteItemObjectRef itemNameInfo");												
			attrList.Clear();
			attrList.Put("href", RefToString(arrayId));
			Write(InternalElementTypeE.Member, "item", attrList, null, false, false);
		}
Esempio n. 2
0
		// Type of string or primitive type which has already been converted to string
		internal	void WriteItemString(NameInfo itemNameInfo, NameInfo typeNameInfo, String value)		
		{
			itemNameInfo.Dump("WriteItemString itemNameInfo");												
			typeNameInfo.Dump("WriteItemString typeNameInfo");

			attrList.Clear();

			if (typeNameInfo.NIobjectId > 0)
			{
				attrList.Put("id", IdToString((int)typeNameInfo.NIobjectId));
			}
			if (itemNameInfo.NItransmitTypeOnMember)
			{
				if (typeNameInfo.NItype == SoapUtil.typeofString)
				{
					if (typeNameInfo.NIobjectId > 0)
					{
						attrList.Put("xsi:type", "SOAP-ENC:string");
						isUsedEnc = true;											
					}
					else
						attrList.Put("xsi:type", "xsd:string");						
				}
				else
					attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true));
			}

            NamespaceAttribute();
			Write(InternalElementTypeE.Member, "item", attrList, value, false, Converter.IsEscaped(typeNameInfo.NIprimitiveTypeEnum));
		}
Esempio n. 3
0
		//internal void WriteItem(Variant value, InternalPrimitiveTypeE code, Boolean isTyped, Type objType)
		internal void WriteItem(NameInfo itemNameInfo, NameInfo typeNameInfo, Object value)
		{
			itemNameInfo.Dump("WriteItem itemNameInfo");												
			typeNameInfo.Dump("WriteItem typeNameInfo");

			attrList.Clear();
			if (itemNameInfo.NItransmitTypeOnMember)
			{
				attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true));
			}

            String stringValue = null;

            if (typeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.QName)
            {
                if (value != null)
                {
                    SoapQName soapQName = (SoapQName)value;
                    if (soapQName.Key == null || soapQName.Key.Length == 0)
                        attrList.Put("xmlns", "");
                    else
                        attrList.Put("xmlns:"+soapQName.Key, soapQName.Namespace);

                    stringValue = soapQName.ToString();
                }
            }
            else
                stringValue = Converter.SoapToString(value, typeNameInfo.NIprimitiveTypeEnum);


            NamespaceAttribute();
			Write(InternalElementTypeE.Member, "item", attrList, stringValue, false, (typeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.Invalid));
		}
Esempio n. 4
0
		internal void WriteNullItem(NameInfo memberNameInfo, NameInfo typeNameInfo)				
		{
			memberNameInfo.Dump("WriteNullItem memberNameInfo");												
			typeNameInfo.Dump("WriteNullItem typeNameInfo");

			String typeName = typeNameInfo.NIname;
			attrList.Clear();
			if (typeNameInfo.NItransmitTypeOnMember &&
				  !((typeName.Equals("System.Object")) ||
					(typeName.Equals("Object")) ||						
					(typeName.Equals("System.Empty") ||
					(typeName.Equals("ur-type")) ||
					(typeName.Equals("anyType"))
                     )))
				attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true));

			attrList.Put("xsi:null", "1");		
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, "item", attrList, null, false, false);
		}
Esempio n. 5
0
        // Determines if a type is a primitive type, if it is it is written

        private bool WriteKnownValueClass(NameInfo memberNameInfo, NameInfo typeNameInfo, Object data, bool isAttribute) 
        {
            InternalST.Soap( this, "WriteKnownValueClass Entry ",typeNameInfo.NIname," ",data," ",memberNameInfo.NIname);
            memberNameInfo.Dump("WriteKnownValueClass memberNameInfo");         
            typeNameInfo.Dump("WriteKnownValueClass typeNameInfo");

            if (typeNameInfo.NItype == Converter.typeofString)
            {
                if (isAttribute)
                    serWriter.WriteAttributeValue(memberNameInfo, typeNameInfo, (String)data);
                else
                    WriteString(memberNameInfo, typeNameInfo, data);
            }
            else
            {
                if (typeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.Invalid)
                {
                    InternalST.Soap( this, "WriteKnownValueClass Exit false");                      
                    return false;
                }
                else
                {
                    if (typeNameInfo.NIisArray) // null if an array
                        serWriter.WriteItem(memberNameInfo, typeNameInfo, data);
                    else
                    {
                        if (isAttribute)
                            serWriter.WriteAttributeValue(memberNameInfo, typeNameInfo, data);
                        else
                            serWriter.WriteMember(memberNameInfo, typeNameInfo, data);
                    }
                }
            }

            InternalST.Soap( this, "WriteKnownValueClass Exit true");
            return true;
        }
Esempio n. 6
0
        } // InternalWriteSerializationHeader


		internal void WriteObject(NameInfo nameInfo, NameInfo typeNameInfo, int numMembers, String[] memberNames, Type[] memberTypes, WriteObjectInfo[] objectInfos)
		{
			nameInfo.Dump("WriteObject nameInfo");
			typeNameInfo.Dump("WriteObject typeNameInfo");						

			int objectId = (int)nameInfo.NIobjectId;
			attrList.Clear();
			if (objectId == topId)
				Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", attrList, null, false, false);

			// Only write the objectId in the top record if the header has been written or
			if	(objectId > 0)
				attrList.Put("id", IdToString((int)nameInfo.NIobjectId));
			// Types when Object is embedded member and types needed			
			if (((nameInfo.NItransmitTypeOnObject || nameInfo.NItransmitTypeOnMember) && (nameInfo.NIisNestedObject || nameInfo.NIisArrayItem)))
				attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true)); 
			if (nameInfo.NIisMustUnderstand)
			{
				attrList.Put("SOAP-ENV:mustUnderstand", "1");
				isUsedEnc = true;
			}
			if (nameInfo.NIisHeader)
            {
                attrList.Put("xmlns:"+nameInfo.NIheaderPrefix, nameInfo.NInamespace);
				attrList.Put("SOAP-ENC:root", "1"); 
            }

			if (attrValueList.Count > 0)
			{
				// Combine the values from the XmlAttributes with the object attributes
				for (int i=0; i<attrValueList.Count; i++)
				{
					String aName;
					String aValue;
					attrValueList.Get(i, out aName, out aValue);
					attrList.Put(aName, aValue);
				}
				attrValueList.Clear();
			}

            String memberName =  MemberElementName(nameInfo, typeNameInfo);
            NamespaceAttribute();
			Write(InternalElementTypeE.ObjectBegin, memberName, attrList, null, true, false); 
		}
Esempio n. 7
0
		internal void WriteMemberObjectRef(NameInfo memberNameInfo, int idRef)
		{
			memberNameInfo.Dump("WriteMemberObjectRef memberNameInfo");						
			attrList.Clear();
			attrList.Put("href", RefToString(idRef));
            String memberName = MemberElementName(memberNameInfo, null);
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, memberName, attrList, null, true, false);
		}
Esempio n. 8
0
		//internal void WriteHeaderString(String name, Boolean isMustUnderstand, int objectId, String value)
		internal	void WriteHeaderString(NameInfo nameInfo, String value)
		{
			nameInfo.Dump("WriteHeaderString nameInfo");

			attrList.Clear();
			attrList.Put("xsi:type", "SOAP-ENC:string");
			isUsedEnc = true;		
			if (nameInfo.NIisMustUnderstand)
				attrList.Put("SOAP-ENV:mustUnderstand", "1");
            attrList.Put("xmlns:"+nameInfo.NIheaderPrefix, nameInfo.NInamespace);
			attrList.Put("SOAP-ENC:root", "1");									
			Write(InternalElementTypeE.Member, nameInfo.NIheaderPrefix+":"+nameInfo.NIname, attrList, value, true, true);
		}
Esempio n. 9
0
		internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, Object value)
		{
			memberNameInfo.Dump("WriteMember memberNameInfo");
			typeNameInfo.Dump("WriteMember typeNameInfo");

			attrList.Clear();
			if ((typeNameInfo.NItype != null) && (memberNameInfo.NItransmitTypeOnMember || (memberNameInfo.NItransmitTypeOnObject && !memberNameInfo.NIisArrayItem)))			
			{
				attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true));
			}

             String stringValue = null;
             if (value != null)
             {
                 if (typeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.QName)
                 {
                     SoapQName soapQName = (SoapQName)value;
                     if (soapQName.Key == null || soapQName.Key.Length == 0)
                         attrList.Put("xmlns", "");
                     else
                         attrList.Put("xmlns:"+soapQName.Key, soapQName.Namespace);
                     
                     stringValue = soapQName.ToString();
                 }
                 else
                 {

                     if (value is String)
                         stringValue = (String)value;
                     else
                         stringValue = Converter.SoapToString(value, typeNameInfo.NIprimitiveTypeEnum);
                 }
             }

			NameInfo tempNameInfo = null;

			// If XmlElement attribute was defined on member, then an alternate member name has been specifed
			if (typeNameInfo.NInameSpaceEnum == InternalNameSpaceE.Interop)
				tempNameInfo = typeNameInfo;

            String memberName = MemberElementName(memberNameInfo, tempNameInfo);
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, memberName, attrList, stringValue, true, Converter.IsEscaped(typeNameInfo.NIprimitiveTypeEnum));
		}
Esempio n. 10
0
		//internal void WriteNullMember(String memberName, Type memberType, Boolean isTyped, Type objType)
		internal void WriteNullMember(NameInfo memberNameInfo, NameInfo typeNameInfo)				
		{
			memberNameInfo.Dump("WriteNullMember memberNameInfo");			
			typeNameInfo.Dump("WriteNullMember typeNameInfo");

			attrList.Clear();
			if ((typeNameInfo.NItype != null) &&
				  (memberNameInfo.NItransmitTypeOnMember ||
				   (memberNameInfo.NItransmitTypeOnObject && !memberNameInfo.NIisArrayItem)))
			{
				attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true));
			}
			attrList.Put("xsi:null", "1");

            /*
			NameInfo tempNameInfo = null;

			// If XmlElement attribute was defined on member, then an alternate member name has been specifed
			if (typeNameInfo.NInameSpaceEnum == InternalNameSpaceE.Interop)
				tempNameInfo = typeNameInfo;
                */

			String memberName = MemberElementName(memberNameInfo, null);
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, memberName, attrList, null, true, false); 
		}
Esempio n. 11
0
		internal void WriteObjectByteArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound, Byte[] byteA)
		{
			memberNameInfo.Dump("WriteObjectByteArray memberNameInfo");
			arrayNameInfo.Dump("WriteObjectByteArray arrayNameInfo");
			arrayElemTypeNameInfo.Dump("WriteObjectByteArray arrayElemTypeNameInfo");

			String byteString = Convert.ToBase64String(byteA);		
			attrList.Clear();
			if (memberNameInfo.NIobjectId == topId)
				Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", attrList, null, false, false);						
			if (arrayNameInfo.NIobjectId > 1)
				attrList.Put("id", IdToString((int)arrayNameInfo.NIobjectId));
			attrList.Put("xsi:type", "SOAP-ENC:Base64");
			isUsedEnc = true;	
            String memberName = MemberElementName(memberNameInfo, null);
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, memberName, attrList, byteString, true, false);
		}
Esempio n. 12
0
		internal void WriteTopPrimitive(NameInfo nameInfo, Object value)
		{
			nameInfo.Dump("WriteMember memberNameInfo");

			attrList.Clear();

			Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", attrList, null, false, false);

			if (nameInfo.NIobjectId >0)
			{
				attrList.Put("id", IdToString((int)nameInfo.NIobjectId));
			}

			String stringValue = null;
			if (value is String)
				stringValue = (String)value;
			else
				stringValue = Converter.SoapToString(value, nameInfo.NIprimitiveTypeEnum);

			Write(InternalElementTypeE.Member, "xsd:"+(Converter.ToXmlDataType(nameInfo.NIprimitiveTypeEnum)), attrList, stringValue, true, false);
		}
Esempio n. 13
0
		internal void WriteObjectString(NameInfo nameInfo, String value)
		{
			InternalST.Soap( this,"WriteObjectString value ",value);
			nameInfo.Dump("WriteObjectString nameInfo");			
			attrList.Clear();
			if (nameInfo.NIobjectId == topId)
				Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", attrList, null, false, false);


			if (nameInfo.NIobjectId >0)
			{
				attrList.Put("id", IdToString((int)nameInfo.NIobjectId));
			}

            String stringType = null;
            if (nameInfo.NIobjectId > 0)
            {
                stringType = "SOAP-ENC:string";
                isUsedEnc = true;											
            }
            else
                stringType = "xsd:string";				

			Write(InternalElementTypeE.Member, stringType, attrList, value, false, Converter.IsEscaped(nameInfo.NIprimitiveTypeEnum));
		}
Esempio n. 14
0
		//internal void WriteHeaderEntry(String name, Boolean isMustUnderstand, InternalPrimitiveTypeE code, Variant value)
		internal void WriteHeaderEntry(NameInfo nameInfo, NameInfo typeNameInfo, Object value)				
		{
			nameInfo.Dump("WriteHeaderEntry nameInfo");
			if (typeNameInfo != null)
			{
				typeNameInfo.Dump("WriteHeaderEntry typeNameInfo");
			}

			attrList.Clear();
			if (value == null)
				attrList.Put("xsi:null", "1");							
			else
				attrList.Put("xsi:type", TypeNameTagResolver(typeNameInfo, true));
			if (nameInfo.NIisMustUnderstand)
			{
				attrList.Put("SOAP-ENV:mustUnderstand", "1");
				isUsedEnc = true;
			}

            attrList.Put("xmlns:"+nameInfo.NIheaderPrefix, nameInfo.NInamespace);
			attrList.Put("SOAP-ENC:root", "1");
			String stringValue = null;

            if (value != null)
            {
                if (typeNameInfo != null && typeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.QName)
                {
                    SoapQName soapQName = (SoapQName)value;
                    if (soapQName.Key == null || soapQName.Key.Length == 0)
                        attrList.Put("xmlns", "");
                    else
                        attrList.Put("xmlns:"+soapQName.Key, soapQName.Namespace);

                    stringValue = soapQName.ToString();
                }
                else
                    stringValue = Converter.SoapToString(value, typeNameInfo.NIprimitiveTypeEnum);
            }

            NamespaceAttribute();
			Write(InternalElementTypeE.Member, nameInfo.NIheaderPrefix+":"+nameInfo.NIname, attrList, stringValue, true, true);
		}
Esempio n. 15
0
		//internal void WriteMemberString(String memberName, int objectId, String value, Boolean isTyped, Type objType)
		internal void WriteMemberString(NameInfo memberNameInfo, NameInfo typeNameInfo, String value)
		{
			memberNameInfo.Dump("WriteMemberString memberNameInfo");						
			typeNameInfo.Dump("WriteMemberString typeNameInfo");

			InternalST.Soap( this, "WriteMemberString memberName ",memberNameInfo.NIname," objectId ",typeNameInfo.NIobjectId," value ",value);
			int objectId = (int)typeNameInfo.NIobjectId;
			attrList.Clear();
			if (objectId > 0)
				attrList.Put("id", IdToString((int)typeNameInfo.NIobjectId));
			if ((typeNameInfo.NItype != null) && (memberNameInfo.NItransmitTypeOnMember || (memberNameInfo.NItransmitTypeOnObject && !memberNameInfo.NIisArrayItem)))						
			{
				if (typeNameInfo.NIobjectId > 0)
				{
					attrList.Put("xsi:type", "SOAP-ENC:string");
					isUsedEnc = true;											
				}
				else
					attrList.Put("xsi:type", "xsd:string");						
			}

			NameInfo tempNameInfo = null;

			// If XmlElement attribute was defined on member, then an alternate member name has been specifed
			if (typeNameInfo.NInameSpaceEnum == InternalNameSpaceE.Interop)
				tempNameInfo = typeNameInfo;

            String memberName = MemberElementName(memberNameInfo, tempNameInfo);
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, memberName, attrList, value, true, Converter.IsEscaped(typeNameInfo.NIprimitiveTypeEnum));
		}
Esempio n. 16
0
		//internal void WriteHeaderObjectRef(String name, Boolean isMustUnderstand, int idRef)
		internal	void WriteHeaderObjectRef(NameInfo nameInfo)
		{
			nameInfo.Dump("WriteHeaderObjectRef nameInfo");						

			attrList.Clear();
			attrList.Put("href", RefToString((int)nameInfo.NIobjectId));
			if (nameInfo.NIisMustUnderstand)
			{				
				attrList.Put("SOAP-ENV:mustUnderstand", "1");
				isUsedEnc = true;
			}
            attrList.Put("xmlns:"+nameInfo.NIheaderPrefix, nameInfo.NInamespace);
			attrList.Put("SOAP-ENC:root", "1");						
			Write(InternalElementTypeE.Member, nameInfo.NIheaderPrefix+":"+nameInfo.NIname, attrList, null, true, true);
		}
Esempio n. 17
0
		internal void WriteJaggedArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound)				
		{
			memberNameInfo.Dump("WriteJaggedArray memberNameInfo");												
			arrayNameInfo.Dump("WriteJaggedArray arrayNameInfo");
			arrayElemTypeNameInfo.Dump("WriteJaggedArray arrayElemTypeNameInfo");

			attrList.Clear();
			if (memberNameInfo.NIobjectId == topId)
				Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", attrList, null, false, false);						
			if (arrayNameInfo.NIobjectId > 1)
				attrList.Put("id", IdToString((int)arrayNameInfo.NIobjectId));
			arrayElemTypeNameInfo.NIitemName = "SOAP-ENC:Array";
			isUsedEnc = true;			
			attrList.Put("SOAP-ENC:arrayType", TypeArrayNameTagResolver(memberNameInfo, arrayNameInfo, true));			
			if (lowerBound != 0)
				attrList.Put("SOAP-ENC:offset","["+lowerBound+"]");
            String memberName = MemberElementName(memberNameInfo, null);
            NamespaceAttribute();
			Write(InternalElementTypeE.ObjectBegin, memberName, attrList, null, false, false);
		}
Esempio n. 18
0
		internal void WriteHeaderMethodSignature(NameInfo nameInfo, NameInfo[] typeNameInfos)
		{
			nameInfo.Dump("WriteHeaderString nameInfo");
			attrList.Clear();
			attrList.Put("xsi:type", "SOAP-ENC:methodSignature");
			isUsedEnc = true;			
			if (nameInfo.NIisMustUnderstand)
				attrList.Put("SOAP-ENV:mustUnderstand", "1");
            attrList.Put("xmlns:"+nameInfo.NIheaderPrefix, nameInfo.NInamespace);
			attrList.Put("SOAP-ENC:root", "1");

			StringBuilder sb = new StringBuilder();
			
			// The signature string is an sequence of prefixed types, where the prefix is the key to the namespace.
			for (int i=0; i<typeNameInfos.Length; i++)
			{	if (i > 0)
					sb.Append(' ');
				sb.Append(NameTagResolver(typeNameInfos[i], true));
			}
			
            NamespaceAttribute();
			Write(InternalElementTypeE.Member, nameInfo.NIheaderPrefix+":"+nameInfo.NIname, attrList, sb.ToString(), true, true);
		}
Esempio n. 19
0
		internal	void WriteRectangleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA)				
		{
			memberNameInfo.Dump("WriteRectangleArray memberNameInfo");												
			arrayNameInfo.Dump("WriteRectangleArray arrayNameInfo");
			arrayElemTypeNameInfo.Dump("WriteRectangleArray arrayElemTypeNameInfo");

			sbOffset.Length = 0;
			sbOffset.Append("[");
			Boolean isZero = true;
			for (int i = 0; i<rank; i++)
			{
				if (lowerBoundA[i] != 0)
					isZero = false;
				if (i > 0)
					sbOffset.Append(",");
				sbOffset.Append(lowerBoundA[i]);
			}
			sbOffset.Append("]");

			attrList.Clear();
			if (memberNameInfo.NIobjectId == topId)
				Write(InternalElementTypeE.ObjectBegin, "SOAP-ENV:Body", attrList, null, false, false);						
			if (arrayNameInfo.NIobjectId > 1)
				attrList.Put("id", IdToString((int)arrayNameInfo.NIobjectId));
			arrayElemTypeNameInfo.NIitemName = NameTagResolver(arrayElemTypeNameInfo, true);
			attrList.Put("SOAP-ENC:arrayType", TypeArrayNameTagResolver(memberNameInfo, arrayNameInfo, true));
			isUsedEnc = true;			
			if (!isZero)
				attrList.Put("SOAP-ENC:offset", sbOffset.ToString());
            String memberName = MemberElementName(memberNameInfo, null);
            NamespaceAttribute();
			Write(InternalElementTypeE.ObjectBegin, memberName, attrList, null, false, false); 
		}
Esempio n. 20
0
        // Writes a given object to the stream.
        private void Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
        {       
            InternalST.Soap( this, "Write 1 Entry objectInfo ",objectInfo,", memberNameInfo ",memberNameInfo,", typeNameInfo ",typeNameInfo);
            memberNameInfo.Dump("Write memberNameInfo");
            typeNameInfo.Dump("Write typeNameInfo");
            Object obj = objectInfo.obj;
            if (obj==null)
                throw new ArgumentNullException("objectInfo.obj", String.Format(SoapUtil.GetResourceString("Serialization_ArgumentNull_Obj"), objectInfo.objectType));

            Type objType = objectInfo.objectType;
            long objectId = objectInfo.objectId;


            InternalST.Soap( this, "Write 1 ",obj," ObjectId ",objectId);

            if (objType == Converter.typeofString)
            {
                // Top level String
                memberNameInfo.NIobjectId = objectId;
                serWriter.WriteObjectString(memberNameInfo, obj.ToString());
            }
            else if (objType == Converter.typeofTimeSpan)
            {
                // Top level TimeSpan
                serWriter.WriteTopPrimitive(memberNameInfo, obj);
            }
            else
            {

                if (objType.IsArray)
                {
                    WriteArray(objectInfo, null, null); 
                }
                else
                {
                    String[] memberNames;
                    Type[] memberTypes;
                    Object[] memberData;
                    SoapAttributeInfo[] memberAttributeInfo;

                    objectInfo.GetMemberInfo(out memberNames, out memberTypes, out memberData, out memberAttributeInfo);

                    // Only Binary needs to transmit types for ISerializable because the binary formatter transmits the types in URT format.
                    // Soap transmits all types as strings, so it is up to the ISerializable object to convert the string back to its URT type
                    if (CheckTypeFormat(formatterEnums.FEtypeFormat, FormatterTypeStyle.TypesAlways))
                    {
                        InternalST.Soap( this, "Write 1 TransmitOnObject ");
                        memberNameInfo.NItransmitTypeOnObject = true;
                        memberNameInfo.NIisParentTypeOnObject = true;
                        typeNameInfo.NItransmitTypeOnObject = true;
                        typeNameInfo.NIisParentTypeOnObject = true;                                             
                    }

                    WriteObjectInfo[] memberObjectInfos = new WriteObjectInfo[memberNames.Length];

                    // Get assembly information
                    // Binary Serializer, assembly names need to be
                    // written before objects are referenced.
                    // GetAssemId here will write out the
                    // assemblyStrings at the right Binary
                    // Serialization object boundary.
                    for (int i=0; i<memberTypes.Length; i++)
                    {
                        Type type = null;
                        if (memberData[i] != null)                        
                            type = GetType(memberData[i]);
                        else
                            type = typeof(Object);

                        InternalPrimitiveTypeE code = Converter.ToCode(type);
                        if ((code == InternalPrimitiveTypeE.Invalid && type != Converter.typeofString) ||
                            ((objectInfo.cache.memberAttributeInfos != null) &&
                             (objectInfo.cache.memberAttributeInfos[i] != null) &&
                             ((objectInfo.cache.memberAttributeInfos[i].IsXmlAttribute()) ||
                              (objectInfo.cache.memberAttributeInfos[i].IsXmlElement()))))
                        {
                            if (memberData[i] != null)
                            {
                                memberObjectInfos[i] =
                                WriteObjectInfo.Serialize
                                (
                                memberData[i],
                                m_surrogates,
                                m_context,
                                serObjectInfoInit,
                                m_formatterConverter,
                                (memberAttributeInfo == null)? null : memberAttributeInfo[i]
                                );                                    
                                memberObjectInfos[i].assemId = GetAssemblyId(memberObjectInfos[i]);
                            }
                            else
                            {
                                memberObjectInfos[i] =
                                WriteObjectInfo.Serialize
                                (
                                memberTypes[i],
                                m_surrogates,
                                m_context,
                                serObjectInfoInit,
                                m_formatterConverter,
                                ((memberAttributeInfo == null) ? null : memberAttributeInfo[i])
                                );
                                memberObjectInfos[i].assemId = GetAssemblyId(memberObjectInfos[i]);
                            }
                        }
                    }

                    Write(objectInfo, memberNameInfo, typeNameInfo, memberNames, memberTypes, memberData, memberObjectInfos);
                }

                InternalST.Soap( this, "Write 1 ",obj," type ",GetType(obj));

                // After first time null members do not have to be written		
                if (!(m_serializedTypeTable.ContainsKey(objType)))
                {
                    InternalST.Soap( this, "Serialize SerializedTypeTable Add ",objType," obj ",obj);           
                    m_serializedTypeTable.Add(objType, objType);
                }
            }

            InternalST.Soap( this, "Write 1 Exit ",obj);        
        }
Esempio n. 21
0
          internal void WriteMemberObjectRef(NameInfo memberNameInfo, NameInfo typeNameInfo, int idRef)
		{
               memberNameInfo.Dump("WriteMemberObjectRef memberNameInfo");						
               attrList.Clear();
               attrList.Put("href", RefToString(idRef));
               NameInfo tempNameInfo = null;

               // If XmlElement attribute was defined on member, then an alternate member name has been specifed
               if (typeNameInfo.NInameSpaceEnum == InternalNameSpaceE.Interop)
                    tempNameInfo = typeNameInfo;
               String memberName = MemberElementName(memberNameInfo, tempNameInfo);
               NamespaceAttribute();
               Write(InternalElementTypeE.Member, memberName, attrList, null, true, false);
          }