public void TestSSLComponent() { IOrbServices orb = OrbServices.GetSingleton(); string iorString = orb.object_to_string(m_newTestService); Ior ior = new Ior(iorString); Assert.IsTrue(ior.Profiles.Length > 0, "nr of profiles"); IIorProfile profile = ior.Profiles[0]; omg.org.IOP.CodecFactory codecFactory = (omg.org.IOP.CodecFactory) orb.resolve_initial_references("CodecFactory"); object sslData = profile.TaggedComponents.GetComponentData(20, codecFactory.create_codec(new omg.org.IOP.Encoding(omg.org.IOP.ENCODING_CDR_ENCAPS.ConstVal, 1, 2)), SSLComponentData.TypeCode); Assert.NotNull(sslData); Assert.AreEqual((int)8087, ((SSLComponentData)sslData).GetPort()); }
public void TestCodeSetComponent() { IOrbServices orb = OrbServices.GetSingleton(); string iorString = orb.object_to_string(m_newTestService); Ior ior = new Ior(iorString); Assert.IsTrue(ior.Profiles.Length > 0, "nr of profiles"); IIorProfile profile = ior.Profiles[0]; omg.org.IOP.CodecFactory codecFactory = (omg.org.IOP.CodecFactory) orb.resolve_initial_references("CodecFactory"); object codeset = profile.TaggedComponents.GetComponentData(1, codecFactory.create_codec(new omg.org.IOP.Encoding(omg.org.IOP.ENCODING_CDR_ENCAPS.ConstVal, 1, 2)), CodeSetComponentData.TypeCode); Assert.NotNull(codeset); Assert.AreEqual((int)CharSet.UTF8, ((CodeSetComponentData)codeset).NativeCharSet); Assert.AreEqual((int)WCharSet.UTF16, ((CodeSetComponentData)codeset).NativeWCharSet); }