private CdrInputStream PrepareStream(byte[] testData) { MemoryStream testStream = new MemoryStream(testData); CdrInputStreamImpl inputStream = new CdrInputStreamImpl(testStream); inputStream.SetMaxLength((uint)testData.Length); inputStream.ConfigStream(0, new GiopVersion(1, 2)); return inputStream; }
private CdrInputStream PrepareStream(byte[] testData) { MemoryStream testStream = new MemoryStream(testData); CdrInputStreamImpl inputStream = new CdrInputStreamImpl(testStream); inputStream.SetMaxLength((uint)testData.Length); inputStream.ConfigStream(0, new GiopVersion(1, 2)); return(inputStream); }
private DataInputStream CreateInputStream(byte[] content) { MemoryStream contentStream = new MemoryStream(content); CdrInputStreamImpl inputStream = new CdrInputStreamImpl(contentStream); inputStream.ConfigStream(0, new GiopVersion(1, 2)); inputStream.SetMaxLength((uint)content.Length); DataInputStreamImpl di = new DataInputStreamImpl(inputStream, m_serFactory); return(di); }
public void TestLocateReplySerialisation() { uint requestId = 5; byte[] objectKey = new byte[] { 116, 101, 115, 116, 111, 98, 106, 101, 99, 116 }; // testobject string targetUri = "testobject"; GiopVersion version = new GiopVersion(1, 2); LocateRequestMessage locReq = new LocateRequestMessage(requestId, objectKey, targetUri); // create a connection context GiopConnectionDesc conDesc = new GiopConnectionDesc(null, null); // create the reply LocateStatus replyStatus = LocateStatus.OBJECT_HERE; LocateReplyMessage locReply = new LocateReplyMessage(replyStatus); MemoryStream targetStream = new MemoryStream(); m_handler.SerialiseOutgoingLocateReplyMessage(locReply, locReq, version, targetStream, conDesc); // check to serialised stream targetStream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(targetStream); cdrIn.ConfigStream(0, version); // first is Giop-magic byte data; AssertBytesFollowing(m_giopMagic, cdrIn); // Giop version data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(1, data); data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(2, data); // flags: big-endian, no fragements data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg type: locate reply data = (byte)cdrIn.ReadOctet(); Assert.AreEqual((byte)GiopMsgTypes.LocateReply, data); // Giop Msg length uint msgLength = cdrIn.ReadULong(); cdrIn.SetMaxLength(msgLength); // req-id Assert.AreEqual(requestId, cdrIn.ReadULong()); // the location status Assert.AreEqual((uint)replyStatus, cdrIn.ReadULong()); }
private CdrInputStreamImpl CreateInputStream(byte[] content, bool isLittleEndian) { MemoryStream stream = new MemoryStream(content); CdrInputStreamImpl cdrStream = new CdrInputStreamImpl(stream); byte endianFlag = 0; if (isLittleEndian) { endianFlag = 1; } cdrStream.ConfigStream(endianFlag, new GiopVersion(1, 1)); cdrStream.SetMaxLength((uint)content.Length); cdrStream.WCharSet = (int)Ch.Elca.Iiop.Services.WCharSet.UTF16; return(cdrStream); }
/// <summary> /// creates an IOR from the IOR stringified form /// </summary> public Ior(string iorAsString) { // iorAsString contains only characters 0-9, A-F and IOR --> all of this are short characters if (iorAsString.StartsWith("IOR:")) { MemoryStream memStream = new MemoryStream(StringConversions.Destringify(iorAsString, 4)); CdrInputStreamImpl cdrStream = new CdrInputStreamImpl(memStream); byte flags = cdrStream.ReadOctet(); cdrStream.ConfigStream(flags, new GiopVersion(1, 2)); // giop dep operation are not used for IORs List <IorProfile> profiles = new List <IorProfile>(); ParseIOR(cdrStream, out m_typId, profiles); m_profiles = profiles.ToArray(); } else { throw new INV_OBJREF(9420, CompletionStatus.Completed_No); } }
/// <summary> /// creates an IOR from the IOR stringified form /// </summary> public Ior(string iorAsString) { // iorAsString contains only characters 0-9, A-F and IOR --> all of this are short characters if (iorAsString.StartsWith("IOR:")) { MemoryStream memStream = new MemoryStream(StringConversions.Destringify(iorAsString, 4)); CdrInputStreamImpl cdrStream = new CdrInputStreamImpl(memStream); byte flags = cdrStream.ReadOctet(); cdrStream.ConfigStream(flags, new GiopVersion(1, 2)); // giop dep operation are not used for IORs List<IorProfile> profiles = new List<IorProfile>(); ParseIOR(cdrStream, out m_typId, profiles); m_profiles = profiles.ToArray(); } else { throw new INV_OBJREF(9420, CompletionStatus.Completed_No); } }
private object[] MarshalAndUnmarshalRequestArgsOnce(MethodInfo testMethod, object[] actual) { ArgumentsSerializerFactory serFactory = m_argSerFactory; ArgumentsSerializer ser = serFactory.Create(testMethod.DeclaringType); MemoryStream data = new MemoryStream(); GiopVersion version = new GiopVersion(1, 2); byte endian = 0; CdrOutputStream targetStream = new CdrOutputStreamImpl(data, endian, version); ser.SerializeRequestArgs(testMethod.Name, actual, targetStream, null); data.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl sourceStream = new CdrInputStreamImpl(data); sourceStream.ConfigStream(endian, version); IDictionary contextElements; object[] deser = ser.DeserializeRequestArgs(testMethod.Name, sourceStream, out contextElements); return(deser); }
private object MarshalAndUnmarshalResponeArgsOnce(MethodInfo testMethod, object returnValue, object[] outArgs, out object[] deserOutArgs) { ArgumentsSerializerFactory serFactory = m_argSerFactory; ArgumentsSerializer ser = serFactory.Create(testMethod.DeclaringType); MemoryStream data = new MemoryStream(); GiopVersion version = new GiopVersion(1, 2); byte endian = 0; CdrOutputStream targetStream = new CdrOutputStreamImpl(data, endian, version); ser.SerializeResponseArgs(testMethod.Name, returnValue, outArgs, targetStream); data.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl sourceStream = new CdrInputStreamImpl(data); sourceStream.ConfigStream(endian, version); object returnValueDeser = ser.DeserializeResponseArgs(testMethod.Name, out deserOutArgs, sourceStream); return(returnValueDeser); }
private CdrInputStreamImpl CreateInputStream(byte[] content, bool isLittleEndian) { MemoryStream stream = new MemoryStream(content); CdrInputStreamImpl cdrStream = new CdrInputStreamImpl(stream); byte endianFlag = 0; if (isLittleEndian) { endianFlag = 1; } cdrStream.ConfigStream(endianFlag, new GiopVersion(1, 1)); cdrStream.SetMaxLength((uint)content.Length); cdrStream.WCharSet = (int)Ch.Elca.Iiop.Services.WCharSet.UTF16; return cdrStream; }
private DataInputStream CreateInputStream(byte[] content) { MemoryStream contentStream = new MemoryStream(content); CdrInputStreamImpl inputStream = new CdrInputStreamImpl(contentStream); inputStream.ConfigStream(0, new GiopVersion(1, 2)); inputStream.SetMaxLength((uint)content.Length); DataInputStreamImpl di = new DataInputStreamImpl(inputStream, m_serFactory); return di; }
internal GiopHeader(CdrInputStreamImpl stream) : this(stream.ReadOpaque(12)) { stream.ConfigStream(m_flags, m_version); stream.SetMaxLength(m_msgLength); }
public void TestRequestSerialisation() { // prepare message MethodInfo methodToCall = typeof(TestService).GetMethod("Add"); object[] args = new object[] { ((Int32)1), ((Int32)2) }; string uri = "iiop://localhost:8087/testuri"; // Giop 1.2 will be used because no version spec in uri Ior target = m_iiopUrlUtil.CreateIorForUrl(uri, ""); TestMessage msg = new TestMessage(methodToCall, args, uri); // prepare connection context GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(null, null, new GiopRequestNumberGenerator(), null); // serialise MemoryStream targetStream = new MemoryStream(); uint reqId = 5; m_handler.SerialiseOutgoingRequestMessage(msg, target.Profiles[0], conDesc, targetStream, reqId); // check to serialised stream targetStream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(targetStream); cdrIn.ConfigStream(0, new GiopVersion(1, 2)); // first is Giop-magic byte data; AssertBytesFollowing(m_giopMagic, cdrIn); // Giop version data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(1, data); data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(2, data); // flags: big-endian, no fragements data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg type: request data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg length uint msgLength = cdrIn.ReadULong(); cdrIn.SetMaxLength(msgLength); // req-id Assert.AreEqual(reqId, cdrIn.ReadULong()); // response flags data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(3, data); cdrIn.ReadPadding(3); // reserved // target Assert.AreEqual(0, cdrIn.ReadUShort()); // target must be testuri encoded as ascii-characters Assert.AreEqual(7, cdrIn.ReadULong()); AssertBytesFollowing( new byte[] { 116, 101, 115, 116, 117, 114, 105 }, cdrIn); // now the target method follows: Add (string is terminated by a zero) Assert.AreEqual(4, cdrIn.ReadULong()); AssertBytesFollowing(new byte[] { 65, 100, 100, 0 }, cdrIn); // now service contexts are following SkipServiceContexts(cdrIn); // Giop 1.2, must be aligned on 8 cdrIn.ForceReadAlign(Aligns.Align8); // now params are following Assert.AreEqual(1, cdrIn.ReadLong()); Assert.AreEqual(2, cdrIn.ReadLong()); }
public void TestLocateReplySerialisation() { uint requestId = 5; byte[] objectKey = new byte[] { 116, 101, 115, 116, 111, 98, 106, 101, 99, 116 }; // testobject string targetUri = "testobject"; GiopVersion version = new GiopVersion(1, 2); LocateRequestMessage locReq = new LocateRequestMessage(requestId, objectKey, targetUri); // create a connection context GiopConnectionDesc conDesc = new GiopConnectionDesc(null, null); // create the reply LocateStatus replyStatus = LocateStatus.OBJECT_HERE; LocateReplyMessage locReply = new LocateReplyMessage(replyStatus); MemoryStream targetStream = new MemoryStream(); m_handler.SerialiseOutgoingLocateReplyMessage(locReply, locReq, version, targetStream, conDesc); // check to serialised stream targetStream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(targetStream); cdrIn.ConfigStream(0, version); // first is Giop-magic byte data; AssertBytesFollowing(m_giopMagic, cdrIn); // Giop version data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(1, data); data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(2, data); // flags: big-endian, no fragements data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg type: locate reply data = (byte) cdrIn.ReadOctet(); Assert.AreEqual((byte)GiopMsgTypes.LocateReply, data); // Giop Msg length uint msgLength = cdrIn.ReadULong(); cdrIn.SetMaxLength(msgLength); // req-id Assert.AreEqual(requestId, cdrIn.ReadULong()); // the location status Assert.AreEqual((uint)replyStatus, cdrIn.ReadULong()); }
public void TestRequestSerialisation() { // prepare message MethodInfo methodToCall = typeof(TestService).GetMethod("Add"); object[] args = new object[] { ((Int32) 1), ((Int32) 2) }; string uri = "iiop://localhost:8087/testuri"; // Giop 1.2 will be used because no version spec in uri Ior target = m_iiopUrlUtil.CreateIorForUrl(uri, ""); TestMessage msg = new TestMessage(methodToCall, args, uri); // prepare connection context GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(null, null, new GiopRequestNumberGenerator(), null); // serialise MemoryStream targetStream = new MemoryStream(); uint reqId = 5; m_handler.SerialiseOutgoingRequestMessage(msg, target.Profiles[0], conDesc, targetStream, reqId); // check to serialised stream targetStream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(targetStream); cdrIn.ConfigStream(0, new GiopVersion(1, 2)); // first is Giop-magic byte data; AssertBytesFollowing(m_giopMagic, cdrIn); // Giop version data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(1, data); data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(2, data); // flags: big-endian, no fragements data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg type: request data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg length uint msgLength = cdrIn.ReadULong(); cdrIn.SetMaxLength(msgLength); // req-id Assert.AreEqual(reqId, cdrIn.ReadULong()); // response flags data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(3, data); cdrIn.ReadPadding(3); // reserved // target Assert.AreEqual(0, cdrIn.ReadUShort()); // target must be testuri encoded as ascii-characters Assert.AreEqual(7 , cdrIn.ReadULong()); AssertBytesFollowing( new byte[] { 116, 101, 115, 116, 117, 114, 105 }, cdrIn); // now the target method follows: Add (string is terminated by a zero) Assert.AreEqual(4, cdrIn.ReadULong()); AssertBytesFollowing(new byte[] { 65, 100, 100, 0}, cdrIn); // now service contexts are following SkipServiceContexts(cdrIn); // Giop 1.2, must be aligned on 8 cdrIn.ForceReadAlign(Aligns.Align8); // now params are following Assert.AreEqual(1, cdrIn.ReadLong()); Assert.AreEqual(2, cdrIn.ReadLong()); }
public void TestReplySerialisation() { // request msg the reply is for MethodInfo methodToCall = typeof(TestService).GetMethod("Add"); object[] args = new object[] { ((Int32) 1), ((Int32) 2) }; string uri = "iiop://localhost:8087/testuri"; // Giop 1.2 will be used because no version spec in uri GiopVersion version = new GiopVersion(1, 2); TestMessage msg = new TestMessage(methodToCall, args, uri); msg.Properties[SimpleGiopMsg.REQUEST_ID_KEY] = (uint)5; msg.Properties[SimpleGiopMsg.GIOP_VERSION_KEY] = version; msg.Properties[SimpleGiopMsg.CALLED_METHOD_KEY] = methodToCall; msg.Properties[SimpleGiopMsg.IDL_METHOD_NAME_KEY] = methodToCall.Name; // done by serialization normally // create a connection context GiopConnectionDesc conDesc = new GiopConnectionDesc(null, null); // create the reply ReturnMessage retMsg = new ReturnMessage((Int32) 3, new object[0], 0, null, msg); MemoryStream targetStream = new MemoryStream(); m_handler.SerialiseOutgoingReplyMessage(retMsg, msg, version, targetStream, conDesc); // check to serialised stream targetStream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(targetStream); cdrIn.ConfigStream(0, new GiopVersion(1, 2)); // first is Giop-magic byte data; AssertBytesFollowing(m_giopMagic, cdrIn); // Giop version data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(1, data); data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(2, data); // flags: big-endian, no fragements data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg type: reply data = (byte) cdrIn.ReadOctet(); Assert.AreEqual(1, data); // Giop Msg length uint msgLength = cdrIn.ReadULong(); cdrIn.SetMaxLength(msgLength); // req-id Assert.AreEqual(5, cdrIn.ReadULong()); // response status: NO_EXCEPTION Assert.AreEqual(0, cdrIn.ReadULong()); // ignore service contexts SkipServiceContexts(cdrIn); // Giop 1.2, must be aligned on 8 cdrIn.ForceReadAlign(Aligns.Align8); // now return value is following Assert.AreEqual(3, cdrIn.ReadLong()); }
private object[] MarshalAndUnmarshalRequestArgsOnce(MethodInfo testMethod, object[] actual) { ArgumentsSerializerFactory serFactory = m_argSerFactory; ArgumentsSerializer ser = serFactory.Create(testMethod.DeclaringType); MemoryStream data = new MemoryStream(); GiopVersion version = new GiopVersion(1, 2); byte endian = 0; CdrOutputStream targetStream = new CdrOutputStreamImpl(data, endian, version); ser.SerializeRequestArgs(testMethod.Name, actual, targetStream, null); data.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl sourceStream = new CdrInputStreamImpl(data); sourceStream.ConfigStream(endian, version); IDictionary contextElements; object[] deser = ser.DeserializeRequestArgs(testMethod.Name, sourceStream, out contextElements); return deser; }
private object MarshalAndUnmarshalResponeArgsOnce(MethodInfo testMethod, object returnValue, object[] outArgs, out object[] deserOutArgs) { ArgumentsSerializerFactory serFactory = m_argSerFactory; ArgumentsSerializer ser = serFactory.Create(testMethod.DeclaringType); MemoryStream data = new MemoryStream(); GiopVersion version = new GiopVersion(1, 2); byte endian = 0; CdrOutputStream targetStream = new CdrOutputStreamImpl(data, endian, version); ser.SerializeResponseArgs(testMethod.Name, returnValue, outArgs, targetStream); data.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl sourceStream = new CdrInputStreamImpl(data); sourceStream.ConfigStream(endian, version); object returnValueDeser = ser.DeserializeResponseArgs(testMethod.Name, out deserOutArgs, sourceStream); return returnValueDeser; }
public void TestReplySerialisation() { // request msg the reply is for MethodInfo methodToCall = typeof(TestService).GetMethod("Add"); object[] args = new object[] { ((Int32)1), ((Int32)2) }; string uri = "iiop://localhost:8087/testuri"; // Giop 1.2 will be used because no version spec in uri GiopVersion version = new GiopVersion(1, 2); TestMessage msg = new TestMessage(methodToCall, args, uri); msg.Properties[SimpleGiopMsg.REQUEST_ID_KEY] = (uint)5; msg.Properties[SimpleGiopMsg.GIOP_VERSION_KEY] = version; msg.Properties[SimpleGiopMsg.CALLED_METHOD_KEY] = methodToCall; msg.Properties[SimpleGiopMsg.IDL_METHOD_NAME_KEY] = methodToCall.Name; // done by serialization normally // create a connection context GiopConnectionDesc conDesc = new GiopConnectionDesc(null, null); // create the reply ReturnMessage retMsg = new ReturnMessage((Int32)3, new object[0], 0, null, msg); MemoryStream targetStream = new MemoryStream(); m_handler.SerialiseOutgoingReplyMessage(retMsg, msg, version, targetStream, conDesc); // check to serialised stream targetStream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(targetStream); cdrIn.ConfigStream(0, new GiopVersion(1, 2)); // first is Giop-magic byte data; AssertBytesFollowing(m_giopMagic, cdrIn); // Giop version data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(1, data); data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(2, data); // flags: big-endian, no fragements data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(0, data); // Giop Msg type: reply data = (byte)cdrIn.ReadOctet(); Assert.AreEqual(1, data); // Giop Msg length uint msgLength = cdrIn.ReadULong(); cdrIn.SetMaxLength(msgLength); // req-id Assert.AreEqual(5, cdrIn.ReadULong()); // response status: NO_EXCEPTION Assert.AreEqual(0, cdrIn.ReadULong()); // ignore service contexts SkipServiceContexts(cdrIn); // Giop 1.2, must be aligned on 8 cdrIn.ForceReadAlign(Aligns.Align8); // now return value is following Assert.AreEqual(3, cdrIn.ReadLong()); }
public void TestWCharSetDefinedServer() { byte[] sourceContent = new byte[] { 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 116, 101, 115, 116, 117, 114, 105, 0, 0, 0, 0, 12, 69, 99, 104, 111, 87, 83, 116, 114, 105, 110, 103, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 9, 0, 0, 0, 8, 0, 116, 0, 101, 0, 115, 0, 116}; MemoryStream sourceStream = new MemoryStream(sourceContent); // create a connection context: this is needed for request deserialisation GiopConnectionDesc conDesc = new GiopConnectionDesc(null, null); // go to stream begin sourceStream.Seek(0, SeekOrigin.Begin); GiopMessageBodySerialiser ser = new GiopMessageBodySerialiser( new ArgumentsSerializerFactory(m_serFactory)); CdrInputStreamImpl cdrSourceStream = new CdrInputStreamImpl(sourceStream); cdrSourceStream.ConfigStream(0, new GiopVersion(1, 2)); cdrSourceStream.SetMaxLength((uint)sourceContent.Length); IMessage result = null; TestStringInterfaceImpl service = new TestStringInterfaceImpl(); try { // object which should be called string uri = "testuri"; RemotingServices.Marshal(service, uri); // deserialise request message result = ser.DeserialiseRequest(cdrSourceStream, new GiopVersion(1,2), conDesc, InterceptorManager.EmptyInterceptorOptions); } finally { RemotingServices.Disconnect(service); } // now check if values are correct Assert.IsTrue(result != null, "deserialised message is null"); object[] args = (object[])result.Properties[SimpleGiopMsg.ARGS_KEY]; Assert.IsTrue(args != null, "args is null"); Assert.AreEqual(1, args.Length); Assert.AreEqual("test", args[0]); }
public void TestSameServiceIdMultiple() { // checks if service contexts with the same id, doesn't throw an exception // checks, that the first service context is considered, others are thrown away GiopMessageBodySerialiser ser = new GiopMessageBodySerialiser( new ArgumentsSerializerFactory(m_serFactory)); MemoryStream stream = new MemoryStream(); CdrOutputStreamImpl cdrOut = new CdrOutputStreamImpl(stream, 0, new GiopVersion(1,2)); cdrOut.WriteULong(2); // nr of contexts cdrOut.WriteULong(1234567); // id of context 1 CdrEncapsulationOutputStream encap = new CdrEncapsulationOutputStream(0); cdrOut.WriteEncapsulation(encap); cdrOut.WriteULong(1234567); // id of context 2 encap = new CdrEncapsulationOutputStream(0); cdrOut.WriteEncapsulation(encap); // reset stream stream.Seek(0, SeekOrigin.Begin); CdrInputStreamImpl cdrIn = new CdrInputStreamImpl(stream); cdrIn.ConfigStream(0, new GiopVersion(1,2)); omg.org.IOP.ServiceContextList result = new ServiceContextList(cdrIn); // check if context is present Assert.IsTrue(result.ContainsServiceContext(1234567), "expected context not in collection"); }
public void TestWCharSetNotDefinedServer() { byte[] sourceContent = new byte[] { 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 116, 101, 115, 116, 117, 114, 105, 0, 0, 0, 0, 12, 69, 99, 104, 111, 87, 83, 116, 114, 105, 110, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 116, 0, 101, 0, 115, 0, 116}; MemoryStream sourceStream = new MemoryStream(sourceContent); // create a connection context: this is needed for request deserialisation GiopConnectionDesc conDesc = new GiopConnectionDesc(null, null); // go to stream begin sourceStream.Seek(0, SeekOrigin.Begin); GiopMessageBodySerialiser ser = new GiopMessageBodySerialiser( new ArgumentsSerializerFactory(m_serFactory)); CdrInputStreamImpl cdrSourceStream = new CdrInputStreamImpl(sourceStream); cdrSourceStream.ConfigStream(0, new GiopVersion(1, 2)); cdrSourceStream.SetMaxLength((uint)sourceContent.Length); IMessage result = null; TestStringInterfaceImpl service = new TestStringInterfaceImpl(); try { // object which should be called string uri = "testuri"; RemotingServices.Marshal(service, uri); // deserialise request message result = ser.DeserialiseRequest(cdrSourceStream, new GiopVersion(1,2), conDesc, InterceptorManager.EmptyInterceptorOptions); Assert.Fail("no exception, although code set not set"); } catch (RequestDeserializationException rde) { Assert.NotNull(rde.Reason, "rde inner exception"); Assert.AreEqual(typeof(BAD_PARAM), rde.Reason.GetType(), "rde type"); } finally { RemotingServices.Disconnect(service); } }