In Java it is possible to overload method signatures. Because OMG's IDL does not allow method overloading, the OMG Java-to-IDL mapping defines a simple name mangling scheme for overloaded methods.
If a method is uniquely defined in a base interface its name will not be mangled within the scope of that interface, but if the method is overloaded by a derived method the name is enhanced within the scope of the derived interface by adding the parameter type names to the original method name, i.e.
void hello(int x) --> void hello__long(in long x)
|
The following example shows how overloaded methods are mapped to .NET.
public interface Greetings extends Remote
{
String hello( String Name) throws RemoteException;
String hello( String FirstName, String LastName) throws RemoteException;
}
|
...
System.Console.WriteLine("{0}", oGreetings.hello__CORBA_WStringValue( "Joe"));
System.Console.WriteLine("{0}", oGreetings.hello__CORBA_WStringValue__CORBA_WStringValue("Joe", "Foo"));
...
|
> 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.