示例#1
0
 public void TestIiopSslLoc()
 {
     string testIiopLoc = "iiop-ssl://elca.ch:1234/test";
     IiopLoc parsed = new IiopLoc(testIiopLoc, m_codec,
                                  new object[] { m_defaultCodeSetTaggedComponent });
     Assert.AreEqual("test", parsed.ObjectUri);
     Assert.AreEqual(1, parsed.GetProfiles().Length);
     Assert.AreEqual(typeof(InternetIiopProfile), parsed.GetProfiles()[0].GetType());
     InternetIiopProfile prof = (InternetIiopProfile)(parsed.GetProfiles()[0]);
     Assert.AreEqual(1, prof.Version.Major);
     Assert.AreEqual(2, prof.Version.Minor);
     Assert.AreEqual("elca.ch", prof.HostName);
     Assert.AreEqual(0, prof.Port);
     
     testIiopLoc = "iiop-ssl1.1://elca.ch:1234/test";
     parsed = new IiopLoc(testIiopLoc, m_codec,
                          new object[] { m_defaultCodeSetTaggedComponent });
     Assert.AreEqual("test", parsed.ObjectUri);
     Assert.AreEqual(1, parsed.GetProfiles().Length);
     Assert.AreEqual(typeof(InternetIiopProfile), parsed.GetProfiles()[0].GetType());
     prof = (InternetIiopProfile)(parsed.GetProfiles()[0]);
     Assert.AreEqual(1, prof.Version.Major);
     Assert.AreEqual(1, prof.Version.Minor);
     Assert.AreEqual("elca.ch", prof.HostName);
     Assert.AreEqual(0, prof.Port);
     Assert.IsTrue(prof.TaggedComponents.ContainsTaggedComponent(
                          CodeSetService.SERVICE_ID));
     Assert.IsTrue(prof.TaggedComponents.ContainsTaggedComponent(
                          TAG_SSL_SEC_TRANS.ConstVal));
 }
示例#2
0
 /// <summary>creates an IOR for the object described by the Url url</summary>
 /// <param name="url">an url of the form IOR:--hex-- or iiop://addr/key</param>
 /// <param name="targetType">if the url contains no info about the target type, use this type</param>
 public Ior CreateIorForUrl(string url, string repositoryId)
 {
     Ior ior = null;
     if (IsIorString(url))
     {
         ior = new Ior(url);
     }
     else if (url.StartsWith("iiop"))
     {
         // iiop1.0, iiop1.1, iiop1.2 (=iiop); extract version in protocol tag
         IiopLoc iiopLoc = new IiopLoc(url, m_codec,
                                       m_defaultAdditionalTaggedComponents);
         // now create an IOR with the above information
         ior = new Ior(repositoryId, iiopLoc.GetProfiles());
     }
     else if (url.StartsWith("corbaloc"))
     {
         Corbaloc loc = new Corbaloc(url, m_codec,
                                     m_defaultAdditionalTaggedComponents);
         IorProfile[] profiles = loc.GetProfiles();
         ior = new Ior(repositoryId, profiles);
     }
     else
     {
         throw new INV_OBJREF(1963, CompletionStatus.Completed_MayBe);
     }
     return ior;
 }