Problem:
- Product Name: VisiBroker for C
- Product Version: 5.2.1
- Product Component: Core ORB
- Platform/OS Version: Windows 2000
VBC 5.2.1: How to use corbaloc to locate non-visibroker ORB POA based server object
Resolution:
It is possible to get a CORBA::BAD_PARAM exception if the corbaloc string is malformed.
The following example uses JacORB server but this is applicable to any CORBA compliant servers.
Generally, CORBALOC has the following format:
corbaloc:[iiop]:[version@]:port[,.....]/A
A in a corbaloc is normally treated as an alias key because it doesn't have the magic of VisiBroker's keys.
The key_string here can be determined from the IOR of the servant. The following IOR is for a typical bank_portable example ported to JacORB:
Interoperable Object Reference:
Type ID: IDL:Bank/AccountManager:1.0
Contains 2 profiles.
Profile 0-IIOP Profile:
version: 1.2
host: 143.186.80.133
port: 3753
Object Key: ForeignId[key_string=StandardImplName/bank_portable/BankManager]
ORB_TYPE Component: Unknown ORB type:1245790976
The key string here is "StandardImplName/bank_portable/BankManager".
So the corbaloc string should look like this:
corbaloc:iiop:1.2@143.186.80.133:3753/StandardImplName/bank_portable/BankManager
However this fails with an OBJECT_NOT_FOUND exception.
If we use the client to do a string_to_object()/object_to_string() transformation we see that the ORB sees the following IOR for that servant:
Interoperable Object Reference:
Type ID: IDL:omg.org/CORBA/Object:1.0
Contains 1 profile.
Profile 0-IIOP Profile:
version: 1.2
host: 143.186.80.133
port: 3753
Object Key: ForeignId[key_string=StandardImplName�nk_portable�nkManager]
The forward slashes in the key_string have been transformed to "%".
If you try to escape the slashes with a back-slash you will usually get a BAD_PARAM.
It turns out that the correct corbaloc string is as follows:
"corbaloc:iiop:1.2@143.186.80.133:3753/StandardImplName//bank_portable//BankManager"
Notice that each forward slash is followed by an escaped forward slash "/".
Author: Michael Mennis
#VisiBroker
#Security



