Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 93309 invoked from network); 12 Mar 2008 00:34:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2008 00:34:48 -0000 Received: (qmail 93732 invoked by uid 500); 12 Mar 2008 00:34:44 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 93694 invoked by uid 500); 12 Mar 2008 00:34:44 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 93685 invoked by uid 99); 12 Mar 2008 00:34:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Mar 2008 17:34:44 -0700 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2008 00:34:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5D9E21A9832; Tue, 11 Mar 2008 17:34:16 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r636160 - in /incubator/cxf/trunk: distribution/ distribution/src/main/release/samples/corba/ distribution/src/main/release/samples/corba/hello_world/ distribution/src/main/release/samples/corba/hello_world/src/corba/client/ distribution/sr... Date: Wed, 12 Mar 2008 00:34:11 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080312003416.5D9E21A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Tue Mar 11 17:34:08 2008 New Revision: 636160 URL: http://svn.apache.org/viewvc?rev=636160&view=rev Log: Copy Yoko hello_world demo and update to use Sun ORB Workaround a bunch of bugs in the Sun ORB Added: incubator/cxf/trunk/distribution/src/main/release/samples/corba/ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/ - copied from r636094, incubator/yoko/trunk/distribution/src/main/samples/ws/hello_world/ incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/ - copied from r636099, incubator/yoko/trunk/distribution/src/main/samples/ws/resources/ Modified: incubator/cxf/trunk/distribution/pom.xml incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/client/Client.java incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/HelloWorldImpl.java incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/Server.java incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/client/Client.java incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/HelloWorldImpl.java incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/Server.java incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/HelloWorld.wsdl incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaObjectHandler.java incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaBindingHelper.java Modified: incubator/cxf/trunk/distribution/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/pom.xml?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/pom.xml (original) +++ incubator/cxf/trunk/distribution/pom.xml Tue Mar 11 17:34:08 2008 @@ -35,6 +35,7 @@ true ${pom.version} + -corba Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/README.txt Tue Mar 11 17:34:08 2008 @@ -1,203 +1,66 @@ -Hello World Demo +Hello World CORBA Demo ================ -Prerequisites -============= +This demo illustrates the use of the JAX-WS APIs to run a simple +"hello world" application using CORBA/IIOP instead of SOAP/XML. It +also contains standard CORBA client/server applications using +pure CORBA code so you can can see the JAX-WS client hit a pure +CORBA server and a pure CORBA client hit the JAX-WS server. -If your environment already includes yoko-${current-yoko-version}.jar on the -CLASSPATH, and the JDK and ant bin directories on the PATH -it is not necessary to run the environment script described in -the samples directory README. If your environment is not -properly configured, or if you are planning on using wsdl2idl/idl2wsdl, -javac, and java to build and run the demos, you must include the -yoko-${current-yoko-version}.jar in the CLASSPATH. Also set -YOKO_HOME to the installation directory. - -Demo Use Cases -============== - -This demo allows the user to run three use cases. - -- Case 1: Web services client & Web services server. - - In this use case, a Web services client talks to a Web services server -through the IIOP protocol. Both the client and the server are implemented using -the CXF Web services framework and the IIOP protocol is enabled by installing -the Yoko CORBA binding into CXF. - - Note: CXF is _not_ part of the Yoko product, but a CXF kit is bundled -with Yoko for convenience of testing and running the Web services demos. - -- Case 2: Web services client & CORBA server. - - In this use case, a Web services client talks to a CORBA server through the -IIOP protocol. The client, which is implemented using CXF, loads the -Yoko CORBA binding to enable the IIOP protocol. The server is implemented using -the Yoko ORB. - -This use case illustrates how a Web services client can be configured to access -a CORBA server, by converting the server's OMG IDL interface into a WSDL interface -with a CORBA binding. - -- Case 3: CORBA client & Web services server. - - In this use case, a CORBA client talks to a Web services server through the -IIOP protocol. The client is implemented using the Yoko ORB. The server, which is -implemented using CXF, loads the Yoko CORBA binding to enable the IIOP protocol. - -This use case illustrates how a Web service can be made accessible to CORBA clients, -by exposing the service through an OMG IDL interface that can be accessed -using the IIOP protocol. - - -Building the Demo -================= - -To build the demo code, perform the following steps: - -1. Open a command prompt and move into the directory /samples/ws/hello_world - -2. Enter the following command (UNIX or Windows): - - ant generate.corba.wsdl - - This command adds a CORBA binding to the samples/ws/resources/HelloWorld.wsdl file, - generating an output file, HelloWorld-corba.wsdl. - -3. Open the HelloWorld-corba.wsdl file using your favorite text editor and add the - following service definition in the scope of the wsdl:definitions element: - - - - - - - - The address specified here, localhost:40000, assumes that the client and server - both run on the same host. If you change this address, you should make sure it is - consistent with the address coded in the - hello_world/src/yoko/server/Server.java, hello_world/src/corba/server/Server.java and - hello_world/src/corba/client/Client.java files. - -4. From the samples/ws/hello_world directory, enter the following command (UNIX or Windows): - - ant build - - This command uses the CXF wsdl2java utility to generate the server & client code. - - -Running the Demo - Use Case 1 -============================= - -To run the demo for the first use case, perform the following steps: - -1. Open a command prompt and move into the directory /samples/ws/hello_world -2. Enter the following command to start the server (on a single command line): +Prerequisite +------------ - UNIX (must use forward slashes): - - java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath $CLASSPATH:build/classes yoko.server.Server & - - Windows (may use either forward or back slashes): - - start java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath %CLASSPATH%;build\classes yoko.server.Server - - The server process starts in the background. We have to set the Xbootclasspath, - because the ORB classes in Yoko conflict with the JDK ORB classes. - -3. Enter the following command to start the client, substituting with your name: - - UNIX: - - java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath $CLASSPATH:build/classes yoko.client.Client - - Windows: - - java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath %CLASSPATH%;build\classes yoko.client.Client - -4. After running the client, use the kill command to terminate the server process (UNIX) or - type Ctrl-C in the server's command window (Windows). - - -Running the Demo - Use Case 2 -============================= - -To run the demo for the second use case, perform the following steps: - -1. Open a command prompt and move into the directory /samples/ws/hello_world - -2. Enter the following command to start the CORBA server (on a single command line): - - UNIX (must use forward slashes): - - java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath $CLASSPATH:build/classes corba.server.Server & - - Windows (may use either forward or back slashes): - - start java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath %CLASSPATH%;build\classes corba.server.Server - - The server process starts in the background. We have to set the Xbootclasspath, - because the ORB classes in Yoko conflict with the JDK ORB classes. - -3. Enter the following command to start the Web services client, substituting with your name: - - UNIX: - - java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath $CLASSPATH:build/classes yoko.client.Client - - Windows: - - java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath %CLASSPATH%;build\classes yoko.client.Client - -4. After running the client, use the kill command to terminate the server process (UNIX) or - type Ctrl-C in the server's command window (Windows). +If your environment already includes cxf-manifest-incubator.jar on the +CLASSPATH, and the JDK and ant bin directories on the PATH +it is not necessary to set the environment as described in +the samples directory README. If your environment is not +properly configured, or if you are planning on using wsdl2java, +javac, and java to build and run the demos, you must set the +environment. -Running the Demo - Use Case 3 -============================= -To run the demo for the third use case, perform the following steps: +Building and running the demo using Ant +--------------------------------------- +From the base directory of this sample (i.e., where this README file is +located), the Ant build.xml file can be used to build and run the demo. +The server and client targets automatically build the demo. -1. Open a command prompt and move into the directory /samples/ws/hello_world +First, if using the Sun ORB built into the JDK, you need to start the orbd +nameing service. From a command prompt, run: -2. Enter the following command to start the Web services server (on a single command line): + orbd -ORBInitialPort 1050 -serverPollingTime 200 - UNIX (must use forward slashes): +Other ORB's may have different requirements. - java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath $CLASSPATH:build/classes yoko.server.Server & - Windows (may use either forward or back slashes): +Use Case 1 - Pure CORBA Server, CXF/JAX-WS Client +------------------------------------------------- +Start the pure CORBA server by running + ant corba.server - start java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath %CLASSPATH%;build\classes yoko.server.Server +Run the JAX-WS client by running: + ant cxf.client - The server process starts in the background. We have to set the Xbootclasspath, - because the ORB classes in Yoko conflict with the JDK ORB classes. -3. Enter the following command to start the CORBA client, substituting with your name: +Use Case 2 - CXF/JAX-WS Server, Pure CORBA Client +------------------------------------------------- +Start the CXF/JAX-WS server by running + ant cxf.server - UNIX: +Run the pure CORBA client by running: + ant corba.client - java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-spec-corba-1.0-incubating-SNAPSHOT.jar:$YOKO_HOME/lib/yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath $CLASSPATH:build/classes corba.client.Client - Windows: +Use Case 3 - CXF/JAX-WS Server, CXF/JAX-WS Client +------------------------------------------------- +Start the CXF/JAX-WS server by running + ant cxf.server - java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-spec-corba-1.0-incubating-SNAPSHOT.jar;%YOKO_HOME%\lib\yoko-core-1.0-incubating-SNAPSHOT.jar - -classpath %CLASSPATH%;build\classes corba.client.Client +Run the CXF/JAX-WS client by running: + ant cxf.client -4. After running the client, use the kill command to terminate the server process (UNIX) or - type Ctrl-C in the server's command window (Windows). Cleanup Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/build.xml Tue Mar 11 17:34:08 2008 @@ -19,105 +19,62 @@ --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - + - - - - - - - - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + - + - + Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/client/Client.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/client/Client.java?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/client/Client.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/client/Client.java Tue Mar 11 17:34:08 2008 @@ -15,27 +15,35 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ package corba.client; import java.util.Properties; -import org.omg.CORBA.Object; import org.omg.CORBA.ORB; import org.omg.CORBA.UserException; -public class Client { +public final class Client { + private Client() { + //not consructed + } + static int run(ORB orb, String[] args) throws UserException { // Get "hello" object - Object obj = orb.string_to_object("corbaloc::localhost:40000/hw"); - if(obj == null) { - System.err.println("Client: Could not resolve target object"); - return 1; - } + // Resolve the HelloWorldImpl by using INS's corbaname url. + // The URL locates the NameService running on localhost + // and listening on 1050 and resolve 'HelloWorld' + // from that NameService + org.omg.CORBA.Object obj = orb.string_to_object("corbaname::localhost:1050#HelloWorld"); + + if (obj == null) { + System.err.println("Client: Could not resolve target object"); + return 1; + } - HelloWorld hello = HelloWorldHelper.narrow(obj); + HelloWorld hello = HelloWorldHelper.narrow(obj); // Test our narrowed "hello" object System.out.println("Invoking greetMe..."); @@ -43,42 +51,35 @@ if (args.length > 0) { result = hello.greetMe(args[args.length - 1]); } else { - result = hello.greetMe(new String()); + result = hello.greetMe("World"); } System.out.println("greetMe.result = " + result); - return 0; + return 0; } // Standalone program initialization public static void main(String args[]) { - int status = 0; - ORB orb = null; + int status = 0; + ORB orb = null; - java.util.Properties props = new Properties(); - props.putAll(System.getProperties()); - props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB"); - props.put("org.omg.CORBA.ORBSingletonClass", - "org.apache.yoko.orb.CORBA.ORBSingleton"); - props.put("yoko.orb.id", "HelloWorld-Client"); - - try { - orb = ORB.init(args, props); - status = run(orb, args); - } catch(Exception ex) { - ex.printStackTrace(); - status = 1; - } - - if(orb != null) { - try { - orb.destroy(); - } catch(Exception ex) { - ex.printStackTrace(); - status = 1; - } - } + try { + orb = ORB.init(args, new Properties()); + status = run(orb, args); + } catch (Exception ex) { + ex.printStackTrace(); + status = 1; + } + + if (orb != null) { + try { + orb.destroy(); + } catch (Exception ex) { + ex.printStackTrace(); + status = 1; + } + } - System.exit(status); + System.exit(status); } } Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/HelloWorldImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/HelloWorldImpl.java?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/HelloWorldImpl.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/HelloWorldImpl.java Tue Mar 11 17:34:08 2008 @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ package corba.server; @@ -23,17 +23,18 @@ public class HelloWorldImpl extends HelloWorldPOA { // The servants default POA - private POA poa_; + private POA poa; - HelloWorldImpl(POA poa) { - poa_ = poa; + HelloWorldImpl(POA p) { + poa = p; } public String greetMe(String inparameter) { - return new String("Hi " + inparameter); + System.out.println("In greetMe(" + inparameter + ")"); + return "Hi " + inparameter; } public POA _default_POA() { - return poa_; + return poa; } } Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/Server.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/Server.java?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/Server.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/corba/server/Server.java Tue Mar 11 17:34:08 2008 @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ package corba.server; @@ -23,38 +23,38 @@ import org.omg.CORBA.ORB; import org.omg.CORBA.UserException; -import org.omg.CORBA.ORBPackage.InvalidName; +import org.omg.CosNaming.NameComponent; +import org.omg.CosNaming.NamingContextExt; +import org.omg.CosNaming.NamingContextExtHelper; import org.omg.PortableServer.POA; import org.omg.PortableServer.POAHelper; import org.omg.PortableServer.POAManager; -import org.apache.yoko.orb.OB.BootManager; -import org.apache.yoko.orb.OB.BootManagerHelper; -import org.apache.yoko.orb.OB.BootManagerPackage.AlreadyExists; +public final class Server { + + private Server() { + } -public class Server { static int run(ORB orb, String[] args) throws UserException { // Resolve Root POA - POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); + POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); // Get a reference to the POA manager - POAManager manager = rootPOA.the_POAManager(); + POAManager manager = poa.the_POAManager(); // Create implementation object - HelloWorldImpl hwImpl = new HelloWorldImpl(rootPOA); - HelloWorld hello = hwImpl._this(orb); + HelloWorldImpl hwImpl = new HelloWorldImpl(poa); - // Add reference to the boot manager - try { - byte[] oid = ("hw").getBytes(); - BootManager bootManager = BootManagerHelper.narrow( - orb.resolve_initial_references("BootManager")); - bootManager.add_binding(oid, hello); - } catch (InvalidName ex) { - throw new RuntimeException(); - } catch (AlreadyExists ex) { - throw new RuntimeException(); - } + byte[] oid = "HelloWorld".getBytes(); + poa.activate_object_with_id(oid, hwImpl); + + org.omg.CORBA.Object ref = poa.create_reference_with_id(oid, HelloWorldHelper.id()); + + // Register in NameService + org.omg.CORBA.Object nsObj = orb.resolve_initial_references("NameService"); + NamingContextExt rootContext = NamingContextExtHelper.narrow(nsObj); + NameComponent[] nc = rootContext.to_name("HelloWorld"); + rootContext.rebind(nc, ref); // Run implementation manager.activate(); @@ -67,28 +67,25 @@ public static void main(String args[]) { java.util.Properties props = new Properties(); props.putAll(System.getProperties()); - props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB"); - props.put("org.omg.CORBA.ORBSingletonClass", - "org.apache.yoko.orb.CORBA.ORBSingleton"); - props.put("yoko.orb.id", "HelloWorld-Server"); - // for this demo, start on localhost, port 40000 - props.put("yoko.orb.oa.endpoint", "iiop --host localhost --port 40000"); - int status = 0; + props.put("org.omg.CORBA.ORBInitialHost", "localhost"); + props.put("org.omg.CORBA.ORBInitialPort", "1050"); + ORB orb = null; + int status = 0; try { orb = ORB.init(args, props); status = run(orb, args); - } catch(Exception ex) { + } catch (Exception ex) { ex.printStackTrace(); status = 1; } - if(orb != null) { + if (orb != null) { try { orb.destroy(); - } catch(Exception ex) { + } catch (Exception ex) { ex.printStackTrace(); status = 1; } Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/client/Client.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/client/Client.java?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/client/Client.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/client/Client.java Tue Mar 11 17:34:08 2008 @@ -15,34 +15,28 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ package yoko.client; -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import javax.xml.namespace.QName; -public final class Client { +import yoko.common.HelloWorld; +import yoko.common.HelloWorldCORBAService; - private static final QName SERVICE_NAME = new QName("http://schemas.apache.org/yoko/idl/HelloWorld", "HelloWorldCORBAService"); +public final class Client { private Client() { } public static void main(String args[]) throws Exception { - URL wsdlUrl = new URL("file:./HelloWorld-corba.wsdl"); - - HelloWorldCORBAService ss = new HelloWorldCORBAService(wsdlUrl, SERVICE_NAME); - HelloWorld port = ss.getHelloWorldCORBAPort(); - + + HelloWorldCORBAService ss = new HelloWorldCORBAService(); + HelloWorld port = ss.getHelloWorldCORBAPort(); System.out.println("Invoking greetMe... "); - java.lang.String _greetMe_outparameter = port.greetMe("Hello There"); - System.out.println("greetMe.result=" + _greetMe_outparameter); - - + java.lang.String greetMeoutparameter = port.greetMe("Hello There"); + System.out.println("greetMe.result=" + greetMeoutparameter); + System.exit(0); } Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/HelloWorldImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/HelloWorldImpl.java?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/HelloWorldImpl.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/HelloWorldImpl.java Tue Mar 11 17:34:08 2008 @@ -15,33 +15,22 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ - + */ package yoko.server; -import java.util.logging.Logger; -import javax.jws.WebMethod; -import javax.jws.WebResult; +import yoko.common.HelloWorld; + @javax.jws.WebService(portName = "HelloWorldCORBAPort", serviceName = "HelloWorldCORBAService", targetNamespace = "http://schemas.apache.org/yoko/idl/HelloWorld", - wsdlLocation = "file:./HelloWorld-corba.wsdl", - endpointInterface = "yoko.server.HelloWorld") + wsdlLocation = "file:./build/HelloWorld-corba.wsdl", + endpointInterface = "yoko.common.HelloWorld") public class HelloWorldImpl implements HelloWorld { - private static final Logger LOG = - Logger.getLogger(HelloWorldImpl.class.getPackage().getName()); - - /* (non-Javadoc) - * @see yoko.server.HelloWorld#greetMe(java.lang.String inparameter )* - */ - public java.lang.String greetMe( - java.lang.String inparameter - ) - { - LOG.info("Executing operation greetMe"); - return new java.lang.String("Hi " + inparameter); + public java.lang.String greetMe(java.lang.String inparameter) { + System.out.println("In greetMe(" + inparameter + ")"); + return "Hi " + inparameter; } } Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/Server.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/Server.java?rev=636160&r1=636094&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/Server.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/hello_world/src/yoko/server/Server.java Tue Mar 11 17:34:08 2008 @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ package yoko.server; @@ -27,7 +27,7 @@ System.out.println("Starting Server"); Object implementor = new HelloWorldImpl(); - String address = "corbaloc::localhost:40000/hw"; + String address = "corbaname::localhost:1050#HelloWorld"; Endpoint.publish(address, implementor); } Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/HelloWorld.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/HelloWorld.wsdl?rev=636160&r1=636099&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/HelloWorld.wsdl (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/HelloWorld.wsdl Tue Mar 11 17:34:08 2008 @@ -17,33 +17,33 @@ * specific language governing permissions and limitations * under the License. --> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + Modified: incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl?rev=636160&r1=636099&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/corba/resources/bank.wsdl Tue Mar 11 17:34:08 2008 @@ -17,176 +17,182 @@ * specific language governing permissions and limitations * under the License. --> - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaConduit.java Tue Mar 11 17:34:08 2008 @@ -31,7 +31,6 @@ import org.apache.cxf.binding.corba.types.CorbaHandlerUtils; import org.apache.cxf.binding.corba.types.CorbaObjectHandler; -import org.apache.cxf.binding.corba.types.CorbaPrimitiveHandler; import org.apache.cxf.binding.corba.utils.ContextUtils; import org.apache.cxf.binding.corba.utils.CorbaBindingHelper; import org.apache.cxf.binding.corba.utils.CorbaUtils; @@ -63,7 +62,6 @@ import org.omg.CORBA.ORB; import org.omg.CORBA.Request; import org.omg.CORBA.SystemException; -import org.omg.CORBA.TCKind; import org.omg.CORBA.TypeCode; import org.omg.CORBA.UnknownUserException; @@ -222,7 +220,7 @@ for (CorbaStreamable argument : arguments) { Any value = orb.create_any(); - setIntoAny(value, argument); + argument.getObject().setIntoAny(value, argument, true); list.add_value(argument.getName(), value, argument.getMode()); } } else { @@ -232,23 +230,12 @@ return list; } - private void setIntoAny(Any value, CorbaStreamable argument) { - switch (argument._type().kind().value()) { - case TCKind._tk_string: - value.insert_string((String)((CorbaPrimitiveHandler)argument.getObject()).getValue()); - break; - //FIXME - other primatives that the Sun ORB apparently cannot handle - default: - value.insert_Streamable(argument); - } - } - protected NamedValue getReturn(CorbaMessage message) { CorbaStreamable retVal = message.getStreamableReturn(); NamedValue ret = null; if (retVal != null) { Any returnAny = orb.create_any(); - returnAny.insert_Streamable(retVal); + retVal.getObject().setIntoAny(returnAny, retVal, false); ret = orb.create_named_value(retVal.getName(), returnAny, org.omg.CORBA.ARG_OUT.value); } else { // TODO: REVISIT: for some reason,some ORBs do not like to Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java Tue Mar 11 17:34:08 2008 @@ -43,7 +43,11 @@ import org.apache.cxf.ws.addressing.AttributedURIType; import org.apache.cxf.ws.addressing.EndpointReferenceType; import org.omg.CORBA.ORB; +import org.omg.CORBA.Object; import org.omg.CORBA.Policy; +import org.omg.CosNaming.NameComponent; +import org.omg.CosNaming.NamingContextExt; +import org.omg.CosNaming.NamingContextExtHelper; import org.omg.PortableServer.POA; import org.omg.PortableServer.POAHelper; import org.omg.PortableServer.POAManager; @@ -240,6 +244,8 @@ } else if (location.startsWith("corbaloc")) { // Try add the key to the boot manager. This is required for a corbaloc addKeyToBootManager(location, obj); + } else if (location.startsWith("corbaname")) { + addKeyToNameservice(location, obj); } else { String ior = orb.object_to_string(obj); address.setLocation(ior); @@ -255,6 +261,17 @@ } } + private void addKeyToNameservice(String location, Object ref) throws Exception { + int idx = location.indexOf("#"); + String name = location.substring(idx + 1); + + //Register in NameService + org.omg.CORBA.Object nsObj = orb.resolve_initial_references("NameService"); + NamingContextExt rootContext = NamingContextExtHelper.narrow(nsObj); + NameComponent[] nc = rootContext.to_name(name); + rootContext.rebind(nc, ref); + } + private void populateEpr(String ior) { AttributedURIType addr = new AttributedURIType(); addr.setValue(ior); @@ -305,7 +322,8 @@ Class bootMgrClass = Class.forName("org.apache.yoko.orb.OB.BootManager"); Method narrowMethod = bootMgrHelperClass.getMethod("narrow", org.omg.CORBA.Object.class); - Object bootMgr = narrowMethod.invoke(null, orb.resolve_initial_references("BootManager")); + java.lang.Object bootMgr = narrowMethod.invoke(null, + orb.resolve_initial_references("BootManager")); Method addBindingMethod = bootMgrClass.getMethod("add_binding", byte[].class, org.omg.CORBA.Object.class); addBindingMethod.invoke(bootMgr, key.getBytes(), value); Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaServerConduit.java Tue Mar 11 17:34:08 2008 @@ -124,7 +124,8 @@ if (arguments != null) { for (int i = 0; i < arguments.length; ++i) { if (list.item(i).flags() != org.omg.CORBA.ARG_IN.value) { - list.item(i).value().insert_Streamable(arguments[i]); + arguments[i].getObject().setIntoAny(list.item(i).value(), + arguments[i], true); } } } @@ -132,7 +133,7 @@ CorbaStreamable resultValue = msg.getStreamableReturn(); if (resultValue != null) { Any resultAny = orb.create_any(); - resultAny.insert_Streamable(resultValue); + resultValue.getObject().setIntoAny(resultAny, resultValue, true); request.set_result(resultAny); } } Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java Tue Mar 11 17:34:08 2008 @@ -278,6 +278,7 @@ CorbaObjectHandler obj = CorbaHandlerUtils.initializeObjectHandler(orb, paramName, paramIdlType, map, service); streamables[i] = corbaMsg.createStreamableObject(obj, paramName); + if (paramMode.value().equals("in")) { streamables[i].setMode(org.omg.CORBA.ARG_IN.value); } else if (paramMode.value().equals("out")) { @@ -287,7 +288,7 @@ } Any value = orb.create_any(); - value.insert_Streamable(streamables[i]); + streamables[i].getObject().setIntoAny(value, streamables[i], false); list.add_value(streamables[i].getName(), value, streamables[i].getMode()); corbaMsg.addStreamableArgument(streamables[i]); } Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaObjectHandler.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaObjectHandler.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaObjectHandler.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaObjectHandler.java Tue Mar 11 17:34:08 2008 @@ -20,8 +20,10 @@ import javax.xml.namespace.QName; +import org.apache.cxf.binding.corba.CorbaStreamable; import org.apache.cxf.binding.corba.wsdl.CorbaTypeImpl; +import org.omg.CORBA.Any; import org.omg.CORBA.TCKind; import org.omg.CORBA.TypeCode; @@ -87,5 +89,9 @@ } public void clear() { + } + + public void setIntoAny(Any value, CorbaStreamable stream, boolean output) { + value.insert_Streamable(stream); } } Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java Tue Mar 11 17:34:08 2008 @@ -20,6 +20,8 @@ import javax.xml.namespace.QName; +import org.apache.cxf.binding.corba.CorbaStreamable; +import org.omg.CORBA.Any; import org.omg.CORBA.TCKind; import org.omg.CORBA.TypeCode; @@ -27,6 +29,8 @@ private static final int UNSIGNED_MAX = 256; private Object value; + private boolean objectSet; + private Any any; public CorbaPrimitiveHandler(QName primName, QName primIdlType, TypeCode primTC, Object primType) { super(primName, primIdlType, primTC, primType); @@ -36,12 +40,71 @@ return value; } - + public void setIntoAny(Any val, CorbaStreamable stream, boolean output) { + any = val; + if (output && value != null) { + switch (this.typeCode.kind().value()) { + case TCKind._tk_boolean: + any.insert_boolean((Boolean)value); + break; + case TCKind._tk_char: + any.insert_char(((Character)value).charValue()); + break; + case TCKind._tk_wchar: + any.insert_wchar(((Character)value).charValue()); + break; + case TCKind._tk_octet: + any.insert_octet(((Byte)value).byteValue()); + break; + case TCKind._tk_short: + any.insert_short(((Short)value).shortValue()); + break; + case TCKind._tk_ushort: + any.insert_ushort((short)((Integer)value).intValue()); + break; + case TCKind._tk_long: + any.insert_long(((Integer)value).intValue()); + break; + case TCKind._tk_longlong: + any.insert_longlong(((Long)value).longValue()); + break; + case TCKind._tk_ulong: + any.insert_ulong((int)((java.math.BigInteger)value).longValue()); + break; + case TCKind._tk_ulonglong: + any.insert_ulonglong(((java.math.BigInteger)value).longValue()); + break; + case TCKind._tk_float: + any.insert_float((Float)value); + break; + case TCKind._tk_double: + any.insert_double((Double)value); + break; + case TCKind._tk_string: + any.insert_string((String)value); + break; + case TCKind._tk_wstring: + any.insert_wstring((String)value); + break; + default: + // Default: assume that whatever stored the data will also know how to convert it into what + // it needs. + val.insert_Streamable(stream); + } + } else { + val.insert_Streamable(stream); + } + } + public void setValue(Object obj) { + objectSet = true; value = obj; } public String getDataFromValue() { + if (!objectSet && any != null) { + return getDataFromAny(); + } String data = ""; switch (this.typeCode.kind().value()) { @@ -149,6 +212,61 @@ // will also know how to convert it into what it needs. value = data; } + } + public String getDataFromAny() { + String data = ""; + switch (this.typeCode.kind().value()) { + case TCKind._tk_boolean: + data = any.extract_boolean() ? "true" : "false"; + break; + case TCKind._tk_char: + char charValue = any.extract_char(); + // outside the normal range it will -256 + data = Byte.toString((byte)(charValue > Byte.MAX_VALUE + ? charValue - UNSIGNED_MAX + : charValue)); + break; + case TCKind._tk_wchar: + data = Character.toString(any.extract_wchar()); + break; + case TCKind._tk_octet: + data = Byte.toString(any.extract_octet()); + break; + case TCKind._tk_short: + data = Short.toString(any.extract_short()); + break; + case TCKind._tk_ushort: + data = Integer.toString(any.extract_ushort()); + break; + case TCKind._tk_long: + data = Integer.toString(any.extract_long()); + break; + case TCKind._tk_longlong: + data = Long.toString(any.extract_longlong()); + break; + case TCKind._tk_ulong: + data = Long.toString(any.extract_ulong()); + break; + case TCKind._tk_ulonglong: + data = java.math.BigInteger.valueOf(any.extract_ulonglong()).toString(); + break; + case TCKind._tk_float: + data = Float.toString(any.extract_float()); + break; + case TCKind._tk_double: + data = Double.toString(any.extract_double()); + break; + case TCKind._tk_string: + data = any.extract_string(); + break; + case TCKind._tk_wstring: + data = any.extract_wstring(); + break; + default: + //should not get here + throw new RuntimeException("Unknown tc: " + this.typeCode); + } + return data; } public void clear() { Modified: incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaBindingHelper.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaBindingHelper.java?rev=636160&r1=636159&r2=636160&view=diff ============================================================================== --- incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaBindingHelper.java (original) +++ incubator/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/utils/CorbaBindingHelper.java Tue Mar 11 17:34:08 2008 @@ -51,7 +51,6 @@ if (config.getOrbSingletonClass() != null) { props.put("org.omg.CORBA.ORBSingletonClass", config.getOrbSingletonClass()); } - props.put("yoko.orb.id", "CXF-CORBA-Binding"); List orbArgs = config.getOrbArgs(); defaultORB = ORB.init(orbArgs.toArray(new String[orbArgs.size()]), props); if (defaultORB == null) { @@ -79,14 +78,13 @@ if (config.getOrbSingletonClass() != null) { props.put("org.omg.CORBA.ORBSingletonClass", config.getOrbSingletonClass()); } - props.put("yoko.orb.id", "CXF-CORBA-Binding-" + address); List orbArgs = config.getOrbArgs(); String scheme = addressURI.getScheme(); // A corbaloc address gives us host and port information to use when setting up the // endpoint for the ORB. Other types of references will just create ORBs on the // host and port used when no preference has been specified. - if ("corbalob".equals(scheme)) { + if ("corbaloc".equals(scheme)) { String schemeSpecificPart = addressURI.getSchemeSpecificPart(); int keyIndex = schemeSpecificPart.indexOf('/'); String corbaAddr = schemeSpecificPart.substring(0, keyIndex); @@ -102,20 +100,26 @@ String port = corbaAddr.substring(index + 1); props.put("yoko.orb.oa.endpoint", new String(protocol + " --host " + host + " --port " + port)); + // WHAT to do for non-yoko orb? + } else if ("corbaname".equals(scheme)) { + String schemeSpecificPart = addressURI.getSchemeSpecificPart(); + if (schemeSpecificPart.startsWith(":")) { + schemeSpecificPart = schemeSpecificPart.substring(1); + } + int idx = schemeSpecificPart.indexOf(':'); - orb = ORB.init(orbArgs.toArray(new String[orbArgs.size()]), props); - - orbList.put(getORBNameFromAddress(address), orb); + props.put("org.omg.CORBA.ORBInitialHost", schemeSpecificPart.substring(0, idx)); + props.put("org.omg.CORBA.ORBInitialPort", schemeSpecificPart.substring(idx + 1)); } else if ("file".equals(scheme) || "relfile".equals(scheme) || "IOR".equals(scheme) || "ior".equals(scheme)) { - orb = ORB.init(orbArgs.toArray(new String[orbArgs.size()]), props); - - orbList.put(getORBNameFromAddress(address), orb); + //use defaults } else { throw new CorbaBindingException("Unsupported address scheme type " + scheme); } + orb = ORB.init(orbArgs.toArray(new String[orbArgs.size()]), props); + orbList.put(getORBNameFromAddress(address), orb); return orb; } @@ -141,8 +145,18 @@ String scheme = addressURI.getScheme(); if ("corbaloc".equals(scheme) || "corbaname".equals(scheme)) { String schemeSpecificPart = addressURI.getSchemeSpecificPart(); + if (schemeSpecificPart.startsWith(":")) { + schemeSpecificPart = schemeSpecificPart.substring(1); + } int keyIndex = schemeSpecificPart.indexOf('/'); - name = schemeSpecificPart.substring(0, keyIndex); + if (keyIndex != -1) { + name = schemeSpecificPart.substring(0, keyIndex); + } else { + name = schemeSpecificPart; + } + if (addressURI.getRawQuery() != null) { + name += addressURI.getRawQuery(); + } } else if ("IOR".equals(scheme) || "ior".equals(scheme)) { name = addressURI.toString(); } else if ("file".equals(scheme) || "relfile".equals(scheme)) {