Configure name space bindings using the wsadmin tool
Use this topic to configure name space bindings with the Jython or Jacl scripting languages and the wsadmin tool. Launch the wsadmin scripting client.
Overview
Use this task and the following examples to configure string, Enterprise JavaBeans (EJB), CORBA, or indirect name space bindings on a cell.
Procedure
- Identify the cell and assign it to the cell variable.
Using Jacl:
set cell [$AdminConfig getid /Cell:mycell/]Example output:mycell(cells/mycell|cell.xml#Cell_1)Use Jython:
cell = AdminConfig.getid('/Cell:mycell/') print cellYou 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:
Use Jacl:
$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)Using Jython:
print AdminConfig.create('StringNameSpaceBinding', cell, [['name', 'binding1'], ['nameInNameSpace', 'myBindings/myString'], ['stringToBind', "This is the String value that gets bound"]])
- To configure an EJB type name space binding:
Use Jacl:
$AdminConfig create EjbNameSpaceBinding $cell {{name binding2} {nameInNameSpace myBindings/myEJB} {applicationNodeName mynode} {bindingLocation SINGLESERVER} {applicationServerName server1} {ejbJndiName ejb/myEJB}}Use Jython:
print 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 an EJB in a cluster, change the configuration example to:
Use Jacl:
$AdminConfig create EjbNameSpaceBinding $cell {{name binding2} {nameInNameSpace myBindings/myEJB} {bindingLocation SERVERCLUSTER} {applicationServerName cluster1} {ejbJndiName ejb/myEJB}}Using Jython:
print 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:
Use Jacl:
$AdminConfig create CORBAObjectNameSpaceBinding $cell {{name binding3} {nameInNameSpace myBindings/myCORBA}{corbanameUrl corbaname:iiop:somehost.somecompany.com:2809#stuff/MyCORBAOjbect} {federatedContext false}}Example output:binding3(cells/mycell|namebindings.xml#CORBAObjectNameSpaceBinding_1)Use Jython:
print AdminConfig.create('CORBAObjectNameSpaceBinding', cell, [['name', 'binding3'],['nameInNameSpace', 'myBindings/myCORBA'],['corbanameUrl','corbaname:iiop:somehost.somecompany.com:2809#stuff/MyCORBAOjbect'], ['federatedContext', 'false']])
- To configure an indirect type name space binding:
Use Jacl:
$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)Using Jython:
print AdminConfig.create('IndirectLookupNameSpaceBinding', cell, [['name', 'binding4'], ['nameInNameSpace','myBindings/myIndirect'], ['providerURL', 'corbaloc::myCompany.com:9809/NameServiceServerRoot'], ['jndiName', 'jndi/name/for/EJB']])
- Save the configuration changes. Enter the following command to save the configuration changes:
Use Jacl:
$AdminConfig saveUsing Jython:
AdminConfig.save()
Enabling and disabling security using scripting
Use scripting (wsadmin)
Getting started with scripting