示例#1
0
        /// <summary>reads an incoming Giop reply message from the Message input stream msgInput</summary>
        /// <remarks>Precondition: sourceStream contains a Giop reply Msg</remarks>
        /// <returns>the .NET reply Msg created from the Giop Reply</returns>
        internal IMessage ParseIncomingReplyMessage(CdrMessageInputStream msgInput,
                                                    IMethodCallMessage requestMessage,
                                                    GiopClientConnectionDesc conDesc)
        {
            Debug.WriteLine("receive reply message at client side");

            CdrInputStream    msgBody = msgInput.GetMessageContentReadingStream();
            GiopClientRequest request = new GiopClientRequest(requestMessage, conDesc, m_interceptionOptions);

            if (request.IsAsyncRequest)
            {
                try {
                    // with respec to interception, this is a new request -> call again send_request interception before reply
                    request.PrepareSecondAscyncInterception();
                    request.InterceptSendRequest();
                } catch (Exception ex) {
                    request.Reply = new ReturnMessage(ex, requestMessage);
                    Exception newException = request.InterceptReceiveException(ex);
                    if (newException == ex)
                    {
                        throw;
                    }
                    else
                    {
                        throw newException; // exeption has been changed by interception point
                    }
                }
            }
            // deserialize message body
            IMessage result = m_ser.DeserialiseReply(msgBody, msgInput.Header.Version, request,
                                                     conDesc);

            return(result);
        }
示例#2
0
        /// <summary>
        /// deserialise from input stream
        /// </summary>
        internal TaggedComponent(CdrInputStream inputStream)
        {
            this.tag = (int)inputStream.ReadULong();
            int componentDataLength = (int)inputStream.ReadULong();

            this.component_data = inputStream.ReadOpaque(componentDataLength);
        }
示例#3
0
        public void TestDecodeNoBomBeStream()
        {
            byte[]         encoded   = new byte[] { 0, 0, 0, 5, 0, 84, 0, 101, 0, 115, 0, 116, 0, 0 }; // Test
            CdrInputStream cdrStream = CreateInputStream(encoded, false);

            Assert.AreEqual("Test", cdrStream.ReadWString(), "wrongly decoded");
        }
示例#4
0
        /// <summary>
        /// deserialise from input stream
        /// </summary>
        internal ServiceContext(CdrInputStream inputStream)
        {
            context_id = (int)inputStream.ReadULong();
            int contextDataLength = (int)inputStream.ReadULong();

            context_data = inputStream.ReadOpaque(contextDataLength);
        }
示例#5
0
        internal object DeserializeResponseArgs(string idlMethodName, out object[] outArgs,
                                                CdrInputStream sourceStream)
        {
            ArgumentsMapping mapping = GetArgumentsMapping(idlMethodName);

            return(mapping.DeserialiseResponseArgs(out outArgs, sourceStream));
        }
示例#6
0
        /// <summary>
        /// parses an IOR embedded in a GIOP message
        /// </summary>
        internal Ior(CdrInputStream cdrStream)
        {
            List <IorProfile> profiles = new List <IorProfile>();

            ParseIOR(cdrStream, out m_typId, profiles);
            m_profiles = profiles.ToArray();
        }
示例#7
0
        public void TestDecodeBeBomLeStream()
        {
            byte[]         encoded   = new byte[] { 6, 0, 0, 0, 0xFE, 0xFF, 0, 84, 0, 101, 0, 115, 0, 116, 0, 0 }; // Test
            CdrInputStream cdrStream = CreateInputStream(encoded, true);

            Assert.AreEqual("Test", cdrStream.ReadWString(), "wrongly decoded");
        }
示例#8
0
        protected override void ReadDataFromStream(CdrInputStream inputStream)
        {
            // internet-iiop profile is encapsulated
            CdrEncapsulationInputStream encapsulation = inputStream.ReadEncapsulation();

            Debug.WriteLine("parse Internet IIOP Profile");
            byte giopMajor = encapsulation.ReadOctet();
            byte giopMinor = encapsulation.ReadOctet();

            m_giopVersion = new GiopVersion(giopMajor, giopMinor);

            Debug.WriteLine("giop-verion: " + m_giopVersion);
            m_hostName = encapsulation.ReadString();
            Debug.WriteLine("hostname: " + m_hostName);
            m_port = encapsulation.ReadUShort();
            Debug.WriteLine("port: " + m_port);
            uint objectKeyLength = encapsulation.ReadULong();

            m_objectKey = new byte[objectKeyLength];
            Debug.WriteLine("object key follows");
            for (uint i = 0; i < objectKeyLength; i++)
            {
                m_objectKey[i] = encapsulation.ReadOctet();
                Debug.Write(m_objectKey[i] + " ");
            }
            Debug.WriteLine("");
            // GIOP 1.1, 1.2:
            if (!(m_giopVersion.Major == 1 && m_giopVersion.Minor == 0))
            {
                m_taggedComponents = new TaggedComponentList(encapsulation);
            }

            Debug.WriteLine("parsing Internet-IIOP-profile completed");
        }
示例#9
0
        private object Unmarshal(Type type, AttributeExtCollection attributes,
                                 CdrInputStream cdrIn)
        {
            Serializer ser = m_serFactory.Create(type, attributes);

            return(ser.Deserialize(cdrIn));
        }
示例#10
0
            internal object DeserialiseResponseArgs(out object[] outArgs,
                                                    CdrInputStream sourceStream)
            {
                // demarshal first the return value;
                object retValue = null;

                if (m_returnValue.IsNonVoidReturn())
                {
                    retValue = m_returnValue.Deserialize(sourceStream);
                }

                // ... then the outargs
                outArgs = new object[m_arguments.Length];
                bool outArgFound = false;

                for (int actualParamNr = 0; actualParamNr < m_arguments.Length; actualParamNr++)
                {
                    ArgumentMapping paramInfo = m_arguments[actualParamNr];
                    if (paramInfo.IsOutArg() || paramInfo.IsRefArg())
                    {
                        outArgs[actualParamNr] = paramInfo.Deserialize(sourceStream);
                        outArgFound            = true;
                    } // else: for an in param null must be added to out-args
                }

                // prepare the result
                // need to return empty array, if no out-arg is present, because otherwise async calls fail
                if (!outArgFound)
                {
                    outArgs = new object[0];
                }
                return(retValue);
            }
示例#11
0
            private IDictionary DeserializeContextElements(CdrInputStream sourceStream,
                                                           Serializer contextElementSer)
            {
                IDictionary result = new HybridDictionary();

                // if no context elements specified, don't deserialise a context sequence.
                if (m_contextElementKeys.Length > 0)
                {
                    string[] contextElems = (string[])contextElementSer.Deserialize(sourceStream);
                    if (contextElems.Length % 2 != 0)
                    {
                        throw new omg.org.CORBA.MARSHAL(67, omg.org.CORBA.CompletionStatus.Completed_No);
                    }
                    for (int i = 0; i < contextElems.Length; i += 2)
                    {
                        string contextElemKey = contextElems[i];
                        // insert into call context, if part of signature
                        for (int j = 0; j < m_contextElementKeys.Length; j++)
                        {
                            if (m_contextElementKeys[j] == contextElemKey)
                            {
                                result[contextElemKey] = contextElems[i + 1];
                                break;
                            }
                        }
                    }
                }
                return(result);
            }
示例#12
0
        public void TestReadStringCodeSetOk()
        {
            byte[]         testData    = new byte[] { 0, 0, 0, 5, 65, 66, 67, 68, 0 };
            CdrInputStream inputStream = PrepareStream(testData);
            string         result      = inputStream.ReadString();

            Assert.AreEqual("ABCD", result, "read string");
        }
示例#13
0
        internal object[] DeserializeRequestArgs(string idlMethodName, CdrInputStream sourceStream,
                                                 out IDictionary contextElements)
        {
            ArgumentsMapping mapping = GetArgumentsMapping(idlMethodName);

            return(mapping.DeserialiseRequestArgs(sourceStream, out contextElements,
                                                  m_contextElementSer));
        }
示例#14
0
        public void TestReadWStringCodeSetNotSet()
        {
            byte[]         testData    = new byte[] { 0, 0, 0, 8, 0, 65, 0, 66, 0, 67, 0, 68 };
            CdrInputStream inputStream = PrepareStream(testData);
            string         result      = inputStream.ReadWString();

            Assert.Fail("no exception, although no wchar code set set");
        }
示例#15
0
 /// <summary>
 /// asserts that the expected byte sequence is following in the stream
 /// </summary>
 private void AssertBytesFollowing(byte[] expected, CdrInputStream cdrIn)
 {
     for (int i = 0; i < expected.Length; i++)
     {
         byte data = (byte)cdrIn.ReadOctet();
         Assert.AreEqual(expected[i], data);
     }
 }
示例#16
0
        /// <summary>
        /// reads a locate-request message.
        /// </summary>
        internal LocateRequestMessage ParseIncomingLocateRequestMessage(CdrMessageInputStream msgInput)
        {
            CdrInputStream msgBody = msgInput.GetMessageContentReadingStream();
            // deserialize message body
            LocateRequestMessage result = m_ser.DeserialiseLocateRequest(msgBody, msgInput.Header.Version);

            Debug.WriteLine("locate request for target-uri: " + result.TargetUri);
            return(result);
        }
示例#17
0
        protected override void ReadDataFromStream(CdrInputStream inputStream)
        {
            Debug.WriteLine("parse unsupported ior profile");
            uint length = inputStream.ReadULong();

            m_data = inputStream.ReadOpaque((int)length);

            Debug.WriteLine("parsing unsupported profile completed");
        }
示例#18
0
        /// <summary>reads an incoming Giop request-message from the message input stream msgInput</summary>
        /// <returns>the .NET request message created from this Giop-message</returns>
        internal IMessage ParseIncomingRequestMessage(CdrMessageInputStream msgInput,
                                                      GiopConnectionDesc conDesc)
        {
            CdrInputStream msgBody = msgInput.GetMessageContentReadingStream();

            // deserialize the message body (the GIOP-request id is included in this message)
            return(m_ser.DeserialiseRequest(msgBody, msgInput.Header.Version,
                                            conDesc, m_interceptionOptions));
        }
示例#19
0
        private static void ParseIOR(CdrInputStream cdrStream, out string typId, List <IorProfile> profiles)
        {
            typId = cdrStream.ReadString();
            ulong nrOfProfiles = cdrStream.ReadULong();

            for (ulong i = 0; i < nrOfProfiles; i++)
            {
                profiles.Add(ParseProfile(cdrStream));
            }
        }
示例#20
0
        protected override void ReadDataFromStream(CdrInputStream inputStream)
        {
            // internet-iiop profile is encapsulated
            CdrEncapsulationInputStream encapsulation = inputStream.ReadEncapsulation();

            Debug.WriteLine("parse Multiple component Profile");
            m_taggedComponents = new TaggedComponentList(encapsulation);

            Debug.WriteLine("parsing multiple components profile completed");
        }
示例#21
0
        public void TestReadWStringCodeSetOk()
        {
            byte[]         testData    = new byte[] { 0, 0, 0, 8, 0, 65, 0, 66, 0, 67, 0, 68 };
            CdrInputStream inputStream = PrepareStream(testData);

            inputStream.WCharSet = (int)Ch.Elca.Iiop.Services.WCharSet.UTF16;
            string result = inputStream.ReadWString();

            Assert.AreEqual("ABCD", result, "read string");
        }
示例#22
0
        private void ReadTaggedComponenttList(CdrInputStream inputStream)
        {
            int nrOfComponents = (int)inputStream.ReadULong();

            m_components = new TaggedComponent[nrOfComponents];
            for (int i = 0; i < nrOfComponents; i++)
            {
                TaggedComponent component = new TaggedComponent(inputStream);
                m_components[i] = component;
            }
        }
示例#23
0
        /// <summary>
        /// skips the service contexts in a request / reply msg
        /// </summary>
        private void SkipServiceContexts(CdrInputStream cdrIn)
        {
            uint nrOfContexts = cdrIn.ReadULong();

            // Skip service contexts: not part of this test
            for (uint i = 0; i < nrOfContexts; i++)
            {
                cdrIn.ReadULong(); // context id
                uint lengthOfContext = cdrIn.ReadULong();
                cdrIn.ReadPadding(lengthOfContext);
            }
        }
示例#24
0
 internal object[] DeserialiseRequestArgs(CdrInputStream sourceStream,
                                          out IDictionary contextElements,
                                          Serializer contextElementSer)
 {
     object[] result = new object[m_arguments.Length];
     for (int actualParamNr = 0; actualParamNr < m_arguments.Length; actualParamNr++)
     {
         ArgumentMapping paramInfo = m_arguments[actualParamNr];
         if (paramInfo.IsInArg() || paramInfo.IsRefArg())
         {
             result[actualParamNr] = paramInfo.Deserialize(sourceStream);
         } // else: null for an out parameter
     }
     contextElements = DeserializeContextElements(sourceStream, contextElementSer);
     return(result);
 }
示例#25
0
        private void ReadSvcContextList(CdrInputStream inputStream)
        {
            uint nrOfServiceContexts = inputStream.ReadULong();

            for (int i = 0; i < nrOfServiceContexts; i++)
            {
                ServiceContext context = new ServiceContext(inputStream);
                if (!m_contexts.Contains(context.context_id))
                {
                    m_contexts[context.context_id] = context;
                }
                else
                {
                    // ignore multiple contexts with same id; iop interfaces allow access by id
                    Debug.WriteLine("ignoring duplicate context with id: " + context.context_id);
                }
            }
        }
示例#26
0
        /// <summary>
        /// parses an IOR-profile embedded in a CDRStream
        /// </summary>
        /// <param name="cdrStream"></param>
        /// <returns></returns>
        private static IorProfile ParseProfile(CdrInputStream cdrStream)
        {
            int profileType = (int)cdrStream.ReadULong();

            switch (profileType)
            {
            case 0:
                IorProfile result = new InternetIiopProfile(cdrStream);
                return(result);

            case 1:
                return(new MultipleComponentsProfile(cdrStream));

            default:
                // unsupported profile type
                return(new UnsupportedIorProfile(cdrStream, profileType));
            }
        }
 private IDictionary DeserializeContextElements(CdrInputStream sourceStream,
                                                Serializer contextElementSer) {
     IDictionary result = new HybridDictionary();
     // if no context elements specified, don't deserialise a context sequence.
     if (m_contextElementKeys.Length > 0) {
         string[] contextElems = (string[])contextElementSer.Deserialize(sourceStream);
         if (contextElems.Length % 2 != 0) {
             throw new omg.org.CORBA.MARSHAL(67, omg.org.CORBA.CompletionStatus.Completed_No);
         }
         for (int i = 0; i < contextElems.Length; i += 2) {
             string contextElemKey = contextElems[i];
             // insert into call context, if part of signature
             for (int j = 0; j < m_contextElementKeys.Length; j++) {
                 if (m_contextElementKeys[j] == contextElemKey) {
                     result[contextElemKey] = contextElems[i + 1];
                     break;
                 }
             }
         }
     }
     return result;
 }
 internal object[] DeserialiseRequestArgs(CdrInputStream sourceStream,
                                          out IDictionary contextElements,
                                          Serializer contextElementSer) {
     object[] result = new object[m_arguments.Length];
     for (int actualParamNr = 0; actualParamNr < m_arguments.Length; actualParamNr++) {
         ArgumentMapping paramInfo = m_arguments[actualParamNr];
         if (paramInfo.IsInArg() || paramInfo.IsRefArg()) {
             result[actualParamNr] = paramInfo.Deserialize(sourceStream);
         } // else: null for an out parameter
     }
     contextElements = DeserializeContextElements(sourceStream, contextElementSer);
     return result;
 }
 internal object Deserialize(CdrInputStream stream) {
     return m_ser.Deserialize(stream);
 }
示例#30
0
        internal override void ReadFromStream(CdrInputStream cdrStream,
                                              SerializerFactory serFactory)
        {
            CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
            m_id = ReadRepositoryId(encap);
            m_name = encap.ReadString();
            TypeCodeSerializer ser = new TypeCodeSerializer(serFactory);
            m_discriminatorType = (omg.org.CORBA.TypeCode)ser.Deserialize(encap);
            Type discrTypeCls = ((TypeCodeImpl)m_discriminatorType).GetClsForTypeCode();
            m_defaultCase = encap.ReadLong();

            uint length = encap.ReadULong();
            m_members = new UnionSwitchCase[length];
            Serializer serDisc =
                serFactory.Create(discrTypeCls,
                                  AttributeExtCollection.EmptyCollection);
            for (int i = 0; i < length; i++)
            {
                object discrLabel = serDisc.Deserialize(encap);
                string memberName = encap.ReadString();
                omg.org.CORBA.TypeCode memberType =
                    (omg.org.CORBA.TypeCode)ser.Deserialize(encap);
                UnionSwitchCase member = new UnionSwitchCase(discrLabel, memberName, memberType);
                m_members[i] = member;
            }
        }
示例#31
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
     m_id = ReadRepositoryId(encap);
     m_name = encap.ReadString();
 }
示例#32
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
     TypeCodeSerializer ser = new TypeCodeSerializer(serFactory);
     m_innerDimension = (TypeCode)ser.Deserialize(encap);
     m_length = (int)encap.ReadULong();
 }
示例#33
0
 /// <summary>reads the type-code content from the stream, without the TCKind at the beginning</summary>
 /// <remarks>helper which is used by the constructor with arg CdrInputStream</remarks>
 internal virtual void ReadFromStream(CdrInputStream cdrStream,
                                      SerializerFactory serFactory) { }
示例#34
0
 /// <summary>
 /// parses an IOR-profile embedded in a CDRStream
 /// </summary>
 /// <param name="cdrStream"></param>
 /// <returns></returns>
 private static IorProfile ParseProfile(CdrInputStream cdrStream)
 {
     int profileType = (int)cdrStream.ReadULong();
     switch (profileType)
     {
         case 0:
             IorProfile result = new InternetIiopProfile(cdrStream);
             return result;
         case 1:
             return new MultipleComponentsProfile(cdrStream);
         default:
             // unsupported profile type
             return new UnsupportedIorProfile(cdrStream, profileType);
     }
 }
示例#35
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     m_length = (int)cdrStream.ReadULong();
 }
示例#36
0
 /// <summary>
 /// reads an unsupported profile from an encapsulation (created with the method readEncapsulation in
 /// CDRStream)
 /// </summary>
 /// <param name="encapsulation"></param>
 public UnsupportedIorProfile(CdrInputStream inputStream, int profileId)
     : base(inputStream)
 {
     m_profileId = profileId;
 }
示例#37
0
 private static void ParseIOR(CdrInputStream cdrStream, out string typId, List<IorProfile> profiles)
 {
     typId = cdrStream.ReadString();
     ulong nrOfProfiles = cdrStream.ReadULong();
     for (ulong i = 0; i < nrOfProfiles; i++)
     {
         profiles.Add(ParseProfile(cdrStream));
     }
 }
 /// <summary>
 /// skips the service contexts in a request / reply msg
 /// </summary>
 private void SkipServiceContexts(CdrInputStream cdrIn) {
     uint nrOfContexts = cdrIn.ReadULong();
     // Skip service contexts: not part of this test
     for (uint i = 0; i < nrOfContexts; i++) {
         uint contextId = cdrIn.ReadULong();
         uint lengthOfContext = cdrIn.ReadULong();
         cdrIn.ReadPadding(lengthOfContext);
     }
 }
示例#39
0
 internal object Deserialize(CdrInputStream stream)
 {
     return(m_ser.Deserialize(stream));
 }
 private object Unmarshal(Type type, AttributeExtCollection attributes,
                          CdrInputStream cdrIn) {
     Serializer ser = m_serFactory.Create(type, attributes);
     return ser.Deserialize(cdrIn);
 }
 internal object DeserializeResponseArgs(string idlMethodName, out object[] outArgs,
                                         CdrInputStream sourceStream) {
     ArgumentsMapping mapping = GetArgumentsMapping(idlMethodName);
     return mapping.DeserialiseResponseArgs(out outArgs, sourceStream);
 }
示例#42
0
 /// <summary>
 /// creates an IOR from the data in a stream
 /// </summary>
 /// <param name="stream">the stream containing the profile data</param>
 protected IorProfile(CdrInputStream stream)
 {
     ReadDataFromStream(stream);
 }
 public DataInputStreamImpl(CdrInputStream cdrIn, SerializerFactory serFactory) {
     m_cdrIn = cdrIn;
     m_serFactory = serFactory;
 }
示例#44
0
 /// <summary>reads this profile data from a stream</summary>
 protected abstract void ReadDataFromStream(CdrInputStream cdrStream);
示例#45
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
     m_id = ReadRepositoryId(encap);
     m_name = encap.ReadString();
     uint length = encap.ReadULong();
     m_members = new string[length];
     for (int i = 0; i < length; i++)
     {
         m_members[i] = encap.ReadString();
     }
 }
示例#46
0
        /// <summary>
        /// reads an InternetIIOPProfile from a cdr stream
        /// </summary>
        /// <param name="encapsulation"></param>
        public InternetIiopProfile(CdrInputStream dataStream)
            : base(dataStream)
        {

        }
示例#47
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
     m_id = ReadRepositoryId(encap);
     m_name = encap.ReadString();
     uint length = encap.ReadULong();
     m_members = new StructMember[length];
     TypeCodeSerializer ser = new TypeCodeSerializer(serFactory);
     for (int i = 0; i < length; i++)
     {
         string memberName = encap.ReadString();
         TypeCode memberType = (TypeCode)ser.Deserialize(encap);
         StructMember member = new StructMember(memberName, memberType);
         m_members[i] = member;
     }
 }
示例#48
0
        protected override void ReadDataFromStream(CdrInputStream inputStream)
        {
            // internet-iiop profile is encapsulated
            CdrEncapsulationInputStream encapsulation = inputStream.ReadEncapsulation();
            Debug.WriteLine("parse Internet IIOP Profile");
            byte giopMajor = encapsulation.ReadOctet();
            byte giopMinor = encapsulation.ReadOctet();
            m_giopVersion = new GiopVersion(giopMajor, giopMinor);

            Debug.WriteLine("giop-verion: " + m_giopVersion);
            m_hostName = encapsulation.ReadString();
            Debug.WriteLine("hostname: " + m_hostName);
            m_port = encapsulation.ReadUShort();
            Debug.WriteLine("port: " + m_port);
            uint objectKeyLength = encapsulation.ReadULong();
            m_objectKey = new byte[objectKeyLength];
            Debug.WriteLine("object key follows");
            for (uint i = 0; i < objectKeyLength; i++)
            {
                m_objectKey[i] = encapsulation.ReadOctet();
                Debug.Write(m_objectKey[i] + " ");
            }
            Debug.WriteLine("");
            // GIOP 1.1, 1.2:
            if (!(m_giopVersion.Major == 1 && m_giopVersion.Minor == 0))
            {
                m_taggedComponents = new TaggedComponentList(encapsulation);
            }

            Debug.WriteLine("parsing Internet-IIOP-profile completed");
        }
示例#49
0
 protected string ReadRepositoryId(CdrInputStream cdrStream)
 {
     return cdrStream.ReadString();
 }
示例#50
0
 /// <summary>
 /// reads a multiple component profile data from a stream
 /// </summary>
 /// <param name="encapsulation"></param>
 public MultipleComponentsProfile(CdrInputStream inputStream)
     : base(inputStream)
 {
 }
示例#51
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
     m_id = ReadRepositoryId(encap);
     m_name = encap.ReadString();
     m_typeMod = encap.ReadShort();
     TypeCodeSerializer ser = new TypeCodeSerializer(serFactory);
     m_baseClass = (TypeCode)ser.Deserialize(encap);
     // deser members
     uint length = encap.ReadULong();
     m_members = new ValueMember[length];
     for (int i = 0; i < length; i++)
     {
         string memberName = encap.ReadString();
         TypeCode memberType = (TypeCode)ser.Deserialize(encap);
         short visibility = encap.ReadShort();
         ValueMember member = new ValueMember(memberName, memberType, visibility);
         m_members[i] = member;
     }
 }
示例#52
0
        protected override void ReadDataFromStream(CdrInputStream inputStream)
        {
            // internet-iiop profile is encapsulated
            CdrEncapsulationInputStream encapsulation = inputStream.ReadEncapsulation();

            Debug.WriteLine("parse Multiple component Profile");
            m_taggedComponents = new TaggedComponentList(encapsulation);

            Debug.WriteLine("parsing multiple components profile completed");
        }
示例#53
0
 internal override void ReadFromStream(CdrInputStream cdrStream,
                                       SerializerFactory serFactory)
 {
     CdrEncapsulationInputStream encap = cdrStream.ReadEncapsulation();
     m_id = ReadRepositoryId(encap);
     m_name = encap.ReadString();
     TypeCodeSerializer ser = new TypeCodeSerializer(serFactory);
     m_aliased = (TypeCode)ser.Deserialize(encap);
 }
示例#54
0
 /// <summary>
 /// reads an unsupported profile from an encapsulation (created with the method readEncapsulation in
 /// CDRStream)
 /// </summary>
 /// <param name="encapsulation"></param>
 public UnsupportedIorProfile(CdrInputStream inputStream, int profileId)
     : base(inputStream)
 {
     m_profileId = profileId;
 }
            internal object DeserialiseResponseArgs(out object[] outArgs,
                                                    CdrInputStream sourceStream) {
                // demarshal first the return value;
                object retValue = null;
                if (m_returnValue.IsNonVoidReturn()) {
                    retValue = m_returnValue.Deserialize(sourceStream);
                }

                // ... then the outargs
                outArgs = new object[m_arguments.Length];
                bool outArgFound = false;
                for (int actualParamNr = 0; actualParamNr < m_arguments.Length; actualParamNr++) {
                    ArgumentMapping paramInfo = m_arguments[actualParamNr];
                    if (paramInfo.IsOutArg() || paramInfo.IsRefArg()) {
                        outArgs[actualParamNr] = paramInfo.Deserialize(sourceStream);
                        outArgFound = true;
                    } // else: for an in param null must be added to out-args
                }

                // prepare the result
                // need to return empty array, if no out-arg is present, because otherwise async calls fail
                if (!outArgFound) {
                    outArgs = new object[0];
                }
                return retValue;
            }
示例#56
0
        protected override void ReadDataFromStream(CdrInputStream inputStream)
        {
            Debug.WriteLine("parse unsupported ior profile");
            uint length = inputStream.ReadULong();
            m_data = inputStream.ReadOpaque((int)length);

            Debug.WriteLine("parsing unsupported profile completed");
        }
 internal object[] DeserializeRequestArgs(string idlMethodName, CdrInputStream sourceStream,
                                          out IDictionary contextElements) {
     ArgumentsMapping mapping = GetArgumentsMapping(idlMethodName);
     return mapping.DeserialiseRequestArgs(sourceStream, out contextElements,
                                           m_contextElementSer);
 }
示例#58
0
 /// <summary>
 /// parses an IOR embedded in a GIOP message
 /// </summary>
 internal Ior(CdrInputStream cdrStream)
 {
     List<IorProfile> profiles = new List<IorProfile>();
     ParseIOR(cdrStream, out m_typId, profiles);
     m_profiles = profiles.ToArray();
 }
示例#59
0
 /// <summary>
 /// deserialise a service context from
 /// </summary>
 /// <param name="inputStream"></param>
 internal TaggedComponentList(CdrInputStream inputStream)
 {
     ReadTaggedComponenttList(inputStream);
 }
示例#60
0
 /// <summary>
 /// deserialise a service context from
 /// </summary>
 /// <param name="inputStream"></param>
 internal ServiceContextList(CdrInputStream inputStream)
 {
     ReadSvcContextList(inputStream);
 }