Arrays - Multi Dimensional Arrays

Description:

The server exports a function which has an array of strings (with 2 dimensions) as parameter and as return value.

Source:

\DemoJava\Arrays

Mapping:

java.lang.String[][] <---> System.String[][]


Example

Step 1. Write the Java server:

  public class GreetingsImpl extends PortableRemoteObject implements Greetings 
  {  
    public String[][] hello( String[][] names)  throws RemoteException 
    {
      ...
      return names;
    }
  }

Step 2. Write the .NET client:

Call the Server:

  String[][] oNames = new String[2][];
  ...
  string[][] oRet = oGreetings.hello( oNames);  
  ...

Step 3. Run the example

a.) Start the sun name service on port 10050:

    > 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.