public void TestWCharSetDefinedClient() { MethodInfo methodToCall = typeof(TestStringInterface).GetMethod("EchoWString"); object[] args = new object[] { "test" }; string uri = "iiop://localhost:8087/testuri"; // Giop 1.2 will be used because no version spec in uri Ior target = m_iiopUrlUtil.CreateIorForUrl(uri, ""); IIorProfile targetProfile = target.Profiles[0]; TestMessage msg = new TestMessage(methodToCall, args, uri); msg.Properties[SimpleGiopMsg.REQUEST_ID_KEY] = (uint)5; // set request-id msg.Properties[SimpleGiopMsg.TARGET_PROFILE_KEY] = targetProfile; // prepare connection context GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(null, null, new GiopRequestNumberGenerator(), null); GiopMessageBodySerialiser ser = new GiopMessageBodySerialiser( new ArgumentsSerializerFactory(m_serFactory)); GiopClientRequest request = new GiopClientRequest(msg, conDesc, new IInterceptionOption[0]); MemoryStream baseStream = new MemoryStream(); CdrOutputStreamImpl targetStream = new CdrOutputStreamImpl(baseStream, 0, new GiopVersion(1,2)); ser.SerialiseRequest(request, targetStream, targetProfile, conDesc); Assert.AreEqual( 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, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 9, 0, 0, 0, 8, 0, 116, 0, 101, 0, 115, 0, 116}, baseStream.ToArray(),"serialised message"); }
public void TestWCharSetNotDefinedClient() { MethodInfo methodToCall = typeof(TestStringInterface).GetMethod("EchoWString"); object[] args = new object[] { "test" }; string uri = "IOR:000000000000000100000000000000010000000000000020000102000000000A6C6F63616C686F73740004D2000000047465737400000000"; Ior target = m_iiopUrlUtil.CreateIorForUrl(uri, ""); IIorProfile targetProfile = target.Profiles[0]; TestMessage msg = new TestMessage(methodToCall, args, uri); msg.Properties[SimpleGiopMsg.REQUEST_ID_KEY] = (uint)5; // set request-id msg.Properties[SimpleGiopMsg.TARGET_PROFILE_KEY] = targetProfile; // prepare connection context GiopClientConnectionDesc conDesc = new GiopClientConnectionDesc(null, null, new GiopRequestNumberGenerator(), null); GiopMessageBodySerialiser ser = new GiopMessageBodySerialiser( new ArgumentsSerializerFactory(m_serFactory)); GiopClientRequest request = new GiopClientRequest(msg, conDesc, new IInterceptionOption[0]); CdrOutputStreamImpl targetStream = new CdrOutputStreamImpl(new MemoryStream(), 0, new GiopVersion(1,2)); ser.SerialiseRequest(request, targetStream, targetProfile, conDesc); }