The following section provides a description on how to create an example network simulator that uses the interfaces defined for the network node that communicates with the Web Services part of the plug-in, see Creating an example network plug-in:
The network simulator application will have the following properties:
Interface used by the Web Services plug-in module, acting on the network simulator application: NetworkInterface.wsdl
Interface used by the network simulator application to deliver network triggered notifications, acting on the Web Services part of the network plug-in: NetworkTriggeredEventListener.wsdl
Interface used by the Web Services plug-in module, in response to an network triggered event: NetworkTriggeredEventResultListener.wsdl
Method used by the Web Services plug-in module, defined in NetworkInterface.wsdl, implemented by the network simulator application
Method used by the Web Services plug-in module, defined in the NetworkTriggeredEventResultListener.wsdl, and implemented by the test application:
Methods invoked by the network simulator application, defined in NetworkTriggeredEventListener.wsdl, and implemented by the Web Services part of the plug-in:
This is general preparations.
Make sure the files for the network simulator application are copied to the directory exampleproj. That is, all files and directories in module_templates\client_impl.
Change directory to bea\wlng21\esdk\build and issue the command ant
Preparing the network simulator application
Open the file exampleproj\client_impl\build.xml.
Edit the location of the NetworkInterface.wsdl, NetworkTriggeredEventListener.wsdl, and NetworkTriggeredEventResultListener.wsdl files. Change the properties networkTriggeredEventListenerWsdl, networkTriggeredEventResultListenerWsdl and networkInterfaceWsdl.
Edit mapping namespaces for the WSDL generation. Change the namespace mapping properties if there have been any changes to classnames or package structure.
Edit the location of the deployment descriptor, in the replaceregexp tag, for the application's web service if there have been ably changes to classnames or package structure.
Compilation of the network simulator application
Compile the network simulator application by changing directory to network_simulator_impl and execute the command ant
Running the network simulator application
This section describes how to prepare the start script for the network simulator application.
Prepare start script
Open the file exampleproj\network_simulator_impl\runMe.bat and edit the HOST variable to fit the port that Network Gatekeeper listens to.
Edit the namesspace for the Web Service that implements the Web Service used by the network simulator application and implemented in the Web Services part of the plug-in. Adapt:
Execute the start script exampleproj\network_simulator_impl\runMe.bat
In the network simulator application, make sure that the network simulator is configured to use the Web Service that the Web Services part of the plug-in implements for listening to network initiated events. By default, the Web service is deployed in http://<Tomcat URL>:8080/wplugin/services/NetworkTriggeredEventListener
Use menu option 5 -Deliver network triggered event to send a network triggered event to the Web Services part of the plug-in. Provide the payload data, originating address, destination address, and a network transaction ID. Make sure that the test application has enabled network triggered events for the destination address.
The data provided, together with an originating address, a destination address and a network transaction ID is propagated through the modules and delivered to the application. If there is an error the network simulator application will printout an error message.
When an application performs an application triggered request, data about the request is printed in the console of the network simulator.