title: How to obtain a CORBA IOR
body: <p>I'm working from a CORBA <a href="http://publib.boulder.ibm.com/infocenter/tivihelp/v8r1/index.jsp?topic=/com.ibm.netcool_OMNIbus.doc/probes/ericsson_ossrc/ericsson_ossrc/wip/reference/ecossrc_devices.html" rel="nofollow">network management spec</a> and I want to obtain the IOR file which contains the information I need to connect to the CORBA service. There is some information about how to obtain the "ExternalNameService.ior" file from the link I posted, but I am not sure what to do. Basically I have an idea of what I want to do which is:</p>
  
  <ol>
  <li>Obtain the IOR.</li>
  <li>Decode it so that I get the IP and Port of the CORBA service.</li>
  <li>Compile the IDLs and use them to connect to the remote resources. </li>
  </ol>
  
  <p>The part I'm stuck on is obtaining the IOR. Any ideas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm trying to provide my own implementation of a probe...not use IBM's. The article simple shows the name of the naming service, which I cannot connect to for some reason...that's my biggest problem. The following code works if I try to connect to a local name service, but fails for the ericsson one. I am providing the right <code>ORBInitialPort</code> and <code>ORBInitialHost</code> as command line arguments.</p>
  
  <pre><code>  ORB orb = ORB.init(args, null);
    String corbalocURL = "ExternalNameService";
    // get the root naming context
    org.omg.CORBA.Object objRef = orb.resolve_initial_references(corbalocURL);
    // Use NamingContextExt instead of NamingContext. This is
    // part of the Interoperable naming Service.
    System.out.println(objRef);
    NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
    System.out.println(ncRef);
  </code></pre>
  
  <p>These are Errors I'm getting:</p>
  
  <pre><code>ERROR : org.omg.CORBA.OBJECT_NOT_EXIST:   vmcid: 0x0  minor code: 0  completed: No
  org.omg.CORBA.OBJECT_NOT_EXIST:   vmcid: 0x0  minor code: 0  completed: No
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
      at java.lang.Class.newInstance0(Class.java:374)
      at java.lang.Class.newInstance(Class.java:327)
      at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:914)
      at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_0.getSystemException(ReplyMessage_1_0.java:111)
      at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:590)
      at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:459)
      at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:355)
      at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:147)
      at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:114)
      at com.sun.corba.se.impl.resolver.BootstrapResolverImpl.list(BootstrapResolverImpl.java:151)
      at com.sun.corba.se.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:55)
      at com.sun.corba.se.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:55)
      at com.sun.corba.se.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:55)
      at com.sun.corba.se.impl.orb.ORBImpl.list_initial_services(ORBImpl.java:1143)
      at HelloClient.main(HelloClient.java:22)
  </code></pre>