Skip to main content

Product: OpenFusion Naming Service

Version: ALL

 

Description:

How to access NameService using corbaloc format?

 

Resolution:

It is possible to use the corbaloc URL format so that a C application can find the OpenFusion Name Service on JacORB. It is not quite as straight forward as just using

"corbaloc:iiop:1.2@:<nameService_serverPort>/NameService"

Below is an example of why this is the case and how it can be done.

Here is an IOR corresponding to an instance of the OpenFusion Name Service:
IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000010000000000000094000102000000000E3231332E34382E39312E313537008C890000004F4F70656E467573696F6E2E4E616D65536572766963652F4F70656E467573696F6E2E4E616D65536572766963652F21778BFF0056D311D6A063D3F9B37F7370770CBCE056D311D6A063D3F9B37F73700000000001000000010000001C00000000000100010000000105010001000101090000000105010001

Here is a decoding of this IOR:

Type, host and port information:
Type = IDL:omg.org/CosNaming/NamingContextExt:1.0
Host = 213.48.91.157
Port = 35977

Here is the corbaloc:iiop URL for the IOR (the two digits following each percent sign correspond to the hexadecimal representation of a character that cannot be in a URL directly, so the percent sign escapes it)

corbaloc:iiop:213.48.91.157:35977/OpenFusion.NameService/OpenFusion.NameService/!w��V�֠c���spw��V�֠c���sp

To help you deal with this situation we provide a utility which will decode the ior for you and provide you with the corbaloc URL. This is found in the bin directory of the OpenFusion installation and it is called iorDecoder. I am assuming you have the ${OF_Install_Dir}/bin on your PATH and you are in the same directory as the NameSingleton.ior file.

Use the command
iorDecoder -corbaloc -file NameSingleton.ior

this should print out the string you should be using in the corbaloc URL.

It should look something like this corbaloc:iiop:213.48.91.157:36449/OpenFusion.NameService/OpenFusion.NameServ ice/!��}�[�ؤE�

On your TAO client side you should be able to use the command
client -ORBInitRef NameService=corbaloc:iiop:213.48.91.157:36449/OpenFusion.NameService/OpenFus ion.NameService/!��}�[�ؤE�

You will need to put quotes round it as the key string as a number of characters in it that could cause translation problems. Some ORBs have proprietary mechanisms which allow you to simplify the corbaloc string and just use "/NotificationService" "/NameService" etc. in the URL instead of the Object Key.

As you are using JacORB you can do this but you need to set it up first. You need to edit the jacorb.properties file on the side where you are running the service which you will find in the classes directory in the OpenFusion installation. You should see the following section

###########################################

### Export of corbaloc IORs

###########################################
In this section you need to add a reference for the Notification service as follows:
jacorb.orb.objectKeyMap.NameService=file:///NameSingleton.ior

When you have done this you will be able to use a corbaloc URL of the form corbaloc:iiop:server:port/NameService on the TAO clients side


#KnowledgeDocs
#OpenFusion
#OpenFusionCORBAService