Java names may contain characters illegal within OMG IDL identifiers, like '$' or other illegal Unicode character (i.e. outside ISO Latin 1). These characters will be replaced (according to the OMG Java-to-IDL mapping) with an 'U' followed by 4 upper case hexadecimal characters representing the Unicode value of the replaced character.
Another problem may be a leading underscore which serves as escape character for IDL identifiers colliding with reserved OMG IDL keywords. The underscore, however, is not transmitted over the wire.
To circumvent the lack of an underscore all Java identifiers with a leading underscore acquire a 'J_' instead of the plain underscore. The example shows this behavior.
_name <---> J_name
Unicode char <---> Uxxxx
public interface Greetings extends Remote { boolean _foo() throws RemoteException; int FeeIn$US() throws RemoteException; } |
... System.Console.WriteLine( "Foo:{0}", oGreetings.J_foo()); System.Console.WriteLine( "FreeIn$US:{0}", oGreetings.FeeInU0024US()); ... |
> start orbd -ORBInitialPort 10050 |
(could also use startNameService.bat located in the DemoJava directory to quick start the name service)
b.) Start the java server by using JNDI CosNaming and work with a name service running on 'localhost' at port '10050':> start java -cp .;Server.jar -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory -Djava.naming.provider.url=iiop://localhost:10050 Server |
(could also use buildServer.bat and startServer.bat located in the JavaServer directory to quick build and run the Java Server)
c.) Start the .NET Client.