Use a script to configure the necessary resources to get up and running quickly with WS-Notification in WebSphere® Application Server.
You can use the example script to configure a default set of resources that enable you to connect WS-Notification applications for development purposes. When executed, the script takes the following actions:
To use the example script, complete the following steps:
####################################################################################### # WS-Notification QuickStart script # # # # This JACL script will quickly create the basic resources required in order to start # # using WS-Notification in WebSphere Application Server Version 6.1 or later # # # # Before executing it you must modify the variables defined below to match your # # configuration settings. # # # # Note: # # - This script is not intended for production use, and is intended for use on # # a standalone server (not Network Deployment) only. # # - The script will search the configuration for an existing bus, and if one is # # not found then a new bus will be created # # - It will then look for an existing Bus Member on the chosen bus. If one is not # # found then one will be created using the default File Store # # - It will then look for an existing service integration bus topic space. If one # # is not found then it will create one. # # # # Execute the script by typing; # # wsadmin -f wsnQuickStart.jacl # # # ####################################################################################### ########################################################### # Configuration variables # # # # Set the following variables to match your configuration # ########################################################### # The URL root of HTTP port on the local server set hostRoot "http://xyz.ibm.com:9080" ####################################################################################### # Now create the configuration objects using the variables defined above # ####################################################################################### # These variables are arbitrary choices and need not be set by the user unless desired. set wsnServiceName "myWSNService" set wsnServicePointName "myWSNServicePoint" set eplName "myNewEPL" set tnsNamespaceURI "http://example.org/topicNamespace/example1" puts "###########################################################" puts "# Check the pre-requisites before we begin #" puts "###########################################################" # Check for the existence of the bus set requiresRestart false set myBuses [ $AdminTask listSIBuses ] set myBus [ lindex $myBuses 0 ] if {$myBus == []} { puts " *** Creating new SIBus " set myBus [ $AdminTask createSIBus { -bus MySampleBus -busSecurity false -scriptCompatibility 6.1 } ] set requiresRestart true } set siBusName [ $AdminConfig showAttribute $myBus name ] puts " service integration bus name: $siBusName " # Check for the existence of the bus member set busMembers [ $AdminTask listSIBusMembers " -bus $siBusName " ] set myBusMember [ lindex $busMembers 0 ] if {$myBusMember == []} { puts "" puts " *** Creating new Bus Member " set nodeName [ lindex [ $AdminTask listNodes ] 0 ] set server [ lindex [ $AdminTask listServers ] 0 ] set busMemberName [ $AdminConfig showAttribute $server name ] set myBusMember [ $AdminTask addSIBusMember " -bus $siBusName -node $nodeName -server $busMemberName " ] puts "" set requiresRestart true } else { set nodeName [ $AdminConfig showAttribute $myBusMember node ] set busMemberName [ $AdminConfig showAttribute $myBusMember server ] } puts " service integration bus Member on node: $nodeName " puts " on server: $busMemberName " # Find a topic space to use set topicSpaces [ $AdminTask listSIBDestinations " -bus $siBusName -type TopicSpace " ] set tSpace [ lindex $topicSpaces 0 ] if {$tSpace == []} { puts " *** Creating a Topic Space " set tSpace [ $AdminTask createSIBDestination " -bus $siBusName -node $nodeName -server $myBusMember -name MyTopicSpace -type TopicSpace " ] puts "" } set siBusTopicSpaceName [ $AdminConfig showAttribute $tSpace identifier ] puts " service integration bus topic space: $siBusTopicSpaceName " puts "" puts "###########################################################" puts "# Create the WS-Notification service #" puts "###########################################################" set newService [ lindex [ $AdminTask listWSNServices " -name $wsnServiceName -bus $siBusName " ] 0 ] if {$newService == []} { set newService [ $AdminTask createWSNService " -name $wsnServiceName -bus $siBusName " ] puts "WS-Notification service created: $wsnServiceName " puts " on bus: $siBusName " } else { puts "WS-Notification service '$wsnServiceName' already exists on bus '$siBusName' " } puts "" puts "###########################################################" puts "# Create the WS-Notification service point #" puts "###########################################################" set eplURLRoot $hostRoot/wsn set wsdlURLRoot $hostRoot/SIBWS/wsdl set newServicePoint [ lindex [ $AdminTask listWSNServicePoints $newService " -name $wsnServicePointName " ] 0 ] if {$newServicePoint == []} { set newServicePoint [ $AdminTask createWSNServicePoint $newService " -name $wsnServicePointName -node $nodeName -server $busMemberName -eplName $eplName -eplURLRoot $eplURLRoot -eplWSDLServingURLRoot $wsdlURLRoot " ] puts "WS-Notification service point created: $wsnServicePointName " puts " on bus member: $busMemberName " puts " on node: $nodeName " } else { puts "WS-Notification service point '$wsnServicePointName' already exists on WS-Notification service '$wsnServiceName' " } puts "" puts "###########################################################" puts "# Create the WS-Notification permanent topic namespace #" puts "###########################################################" set newTopicNamespace [ lindex [ $AdminTask listWSNTopicNamespaces $newService " -namespace $tnsNamespaceURI " ] 0 ] if {$newTopicNamespace == []} { set newTopicNamespace [ $AdminTask createWSNTopicNamespace $newService " -namespace $tnsNamespaceURI -busTopicSpace $siBusTopicSpaceName -reliability RELIABLE_PERSISTENT " ] puts "WS-Notification topic namespace created: $tnsNamespaceURI " puts " bus topic space: $siBusTopicSpaceName " } else { puts "WS-Notification permanent topic namespace already exists: $tnsNamespaceURI " } ####################################################################################### # All the objects have been created - inform the user where to proceed next # ####################################################################################### puts "" puts "###########################################################" puts "# Summary #" puts "###########################################################" # Calculate where you would find the WSDL for the new service. set brokerInboundService [ $AdminTask getWSN_SIBWSInboundService $newService " -type BROKER " ] set svcName [ $AdminConfig showAttribute $brokerInboundService name ] set wsdlLocation $wsdlURLRoot/$siBusName/$svcName puts " The WSDL for the new service can be viewed at the following location; " puts " $wsdlLocation " puts "" puts " Your web service applications can publish and subscribe to any topics in the namespace; " puts " $tnsNamespaceURI " puts "" if {$requiresRestart == "true"} { puts " You must now restart the server for the changes to take effect. " puts "" } puts "" puts "###########################################################" puts "# Save the configuration and exit #" puts "###########################################################" $AdminConfig save exit
In this information ...Related concepts
Related tasks
| IBM Redbooks, demos, education, and more(Index) |