Example: Configuring name space bindings using wsadmin
This example configures name space binding on a cell.
- Identify the cell and assign it to the cell variable.
set cell [$AdminConfig getid /Cell:mycell/]Example output:
mycell(cells/mycell/cell.xml#Cell_1)You can change this example to configure on a node or server here.- Add a new name space binding on the cell. There are four binding types to choose from when configuring a new name space binding. They are string, EJB, CORBA, and indirect.
- To configure a string type name space binding:
$AdminConfig create StringNameSpaceBinding $cell {{name binding1} {nameInNameSpace myBindings/myString} {stringToBind "This is the String value that gets bound"}}Example output:binding1(cells/mycell:namebindings.xml#StringNameSpaceBinding_1)- To configure an enterprise bean type name space binding:
$AdminConfig create EjbNameSpaceBinding $cell {{name binding2} {nameInNameSpace myBindings/myEJB} {applicationNodeName mynode} {bindingLocation SINGLESERVER} {applicationServerName server1} {ejbJndiName ejb/myEJB}}This example is for an EJB located in a server. For EJB in a cluster, change the configuration example to:
$AdminConfig create EjbNameSpaceBinding $cell {{name binding2} {nameInNameSpace myBindings/myEJB} {bindingLocation SERVERCLUSTER} {applicationServerName cluster1} {ejbJndiName ejb/myEJB}}Example output:
binding2(cells/mycell:namebindings.xml#EjbNameSpaceBinding_1)- To configure a CORBA type name space binding:
$AdminConfig create CORBAObjectNameSpaceBinding $cell {{name binding3} {nmeInNameSpace myBindings/myCORBA} {corbanameUrl corbaname:iiop:somehost.somecompany.com:2809#stuff/MyCORBAOjbect} {federatedContext false}}Example output:
binding3(cells/mycell:namebindings.xml#CORBAObjectNameSpaceBinding_1)- To configure an indirect type name space binding:
$AdminConfig create IndirectLookupNameSpaceBinding $cell {{name binding4} {nameInNameSpace myBindings/myIndirect} {providerURL corbaloc::myCompany.com:9809/NameServiceServerRoot} {jndiName jndi/name/for/EJB}}Example output:
binding4(cells/mycell:namebindings.xml#IndirectLookupNameSpaceBinding_1)
- Save the changes with the following command:
$AdminConfig save