static void Main() { log4net.Config.XmlConfigurator.Configure(); OrbServices.CreateAndRegisterIiopChannel(0); String componentModel = Resources.ComponentDesc; TextReader file = new StringReader(componentModel); XmlTextReader componentInformation = new XmlTextReader(file); XmlComponentBuilder builder = new XmlComponentBuilder(componentInformation); ComponentContext pingContext = builder.build(); //Escrevendo a IOR do IComponent no arquivo. IComponent pingComponent = pingContext.GetIComponent(); OrbServices orb = OrbServices.GetSingleton(); String ior = orb.object_to_string(pingComponent); String iorPath = Resources.IorFilename; StreamWriter stream = new StreamWriter(iorPath); try { stream.Write(ior); } finally { stream.Close(); } Console.WriteLine("Componente ping está no ar."); Console.ReadLine(); }
public static void Main(string[] args) { // register the channel IDictionary props = new Hashtable(); props[IiopChannel.CHANNEL_NAME_KEY] = "securedServerIiopChannel"; props[IiopServerChannel.PORT_KEY] = "8087"; props[IiopChannel.TRANSPORT_FACTORY_KEY] = "Ch.Elca.Iiop.Security.Ssl.SslTransportFactory,SSLPlugin"; props[SslTransportFactory.SERVER_REQUIRED_OPTS] = "96"; props[SslTransportFactory.SERVER_SUPPORTED_OPTS] = "96"; props[SslTransportFactory.SERVER_AUTHENTICATION] = "Ch.Elca.Iiop.Security.Ssl.DefaultServerAuthenticationImpl,SSLPlugin"; props[DefaultServerAuthenticationImpl.SERVER_CERTIFICATE] = "5f4abc1aad19e53857be2a4bbec9297091f0082c"; props[DefaultServerAuthenticationImpl.STORE_LOCATION] = "CurrentUser"; IiopChannel chan = new IiopChannel(props); ChannelServices.RegisterChannel(chan, false); AdderImpl adder = new AdderImpl(); string objectURI = "adder"; RemotingServices.Marshal(adder, objectURI); // write out ior to file OrbServices orb = OrbServices.GetSingleton(); string ior = orb.object_to_string(adder); TextWriter writer = new StreamWriter(@"ior"); writer.WriteLine(ior); writer.Close(); Console.WriteLine("server ior: " + ior.ToString()); Console.WriteLine("server running"); Thread.Sleep(Timeout.Infinite); }
public static string GetIorForProxy(object proxy) { OrbServices orbSvc = OrbServices.GetSingleton(); return(orbSvc.object_to_string(proxy)); }
public string GetIorStringForThisObject() { OrbServices orbServices = OrbServices.GetSingleton(); return(orbServices.object_to_string(this)); }