The Client Simulator view allows you to emulate the clients in IBM WebSphere InterChange Server interfaces--connector agents and access clients. The view provides interfaces to connect the clients to the server, create and send business object requests, and reply with business object responses.
The following sections describe the numerous ways you can show and close Client Simulator views.
The "Default interface position" column in Table 29 lists the views whose default positions in the interface are overlaid with the Client Simulator views in the "Client Simulator view number" column.
Table 29. Default Client Simulator view positions
Client Simulator view number | Default interface position |
---|---|
Test Connector 1 | ITE Navigator |
Test Connector 2 | Outline |
Test Connector 3 | Properties |
Test Connector 4 | Dependency |
Test Connector 5 | ITE Navigator |
Test Connector 6 | Outline |
Test Connector 7 | Properties |
Test Connector 8 | Dependency |
Test Connector 9 | ITE Navigator |
Use one of the following techniques to show Client Simulator views for the connectors and access clients in the interface you are testing:
Table 29 shows the default interface positions in which the different Client Simulator views are displayed.
Use one of the following techniques to close Client Simulator views:
You must connect Client Simulator views to the server to emulate a connector as part of testing an interface.
When using the Client Simulator view, you can either emulate a connector using the definition in the repository or using a configuration file. You can also use the Client Simulator view to emulate an access client.
Note that you can also use the Task Manager view to connect agents to the server. For more information, see Table 25.
Do one of the following to connect to the server using the repository definition of the connector:
Do the following to connect to the server using a configuration file:
To emulate an access client, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Connect.
Use the following indicators to determine if a Client Simulator has successfully connected to the server:
For more information about the Status Pane, see Using the Status Pane.
For more information about the Input Pane, see Using the Input Pane.
To disconnect a Client Simulator that is emulating a connector from the server, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Server > Disconnect.
A Client Simulator view also disconnects from the server when you close it. The only way to disconnect a Client Simulator view that is emulating an access client from the server is to close the Client Simulator view. For more information on closing Client Simulator views, see Closing Client Simulator views.
The Client Simulator view has several panes you use to simulate the behavior of a connector or access client.
You use the Input Pane in the Client Simulator view to work with and send business object requests. You can create business object instances, add data to their attributes, and send them as requests. You typically use the Input Pane when working with a Client Simulator view that is emulating a source client in an interface.
Figure 83 shows the Input Pane for a Client Simulator view that is emulating a source connector.
Figure 83. Client Simulator view Input Pane
You use the Result Pane in the Client Simulator view to work with business object requests that have been received and to send business object responses. You typically use the Result Pane when working with a Client Simulator view that is emulating a destination client in an interface.
Figure 84 shows the Result Pane for a Client Simulator view that is emulating a destination connector.
Figure 84. Client Simulator view Result Pane
The Status Pane contains messages about the execution of the Client Simulator view. For instance, the message "[AppConnector: Connector has recovered]" is written to the Status Pane when a connector has successfully connected to the server.
You use the Status Pane primarily to confirm that Client Simulator has successfully connected to the server and to perform troubleshooting. For instance, if you send a business object request from a Client Simulator view and there is no subscription for the business object type, then a message is written to the Status Pane. This can help you to determine why a business object request does not appear in the Result Pane of a Client Simulator view emulating a destination client in an interface.
Figure 85 shows the Status Pane for a Client Simulator view.
Figure 85. Client Simulator view Status Pane
You can arrange a Client Simulator view so that it displays the Input, Result, and Status panes simultaneously, stacked on top of one another. This view can be helpful when a Client Simulator view is emulating a client that has to handle both event notification and request processing responsibilities.
Do one of the following to arrange the Client Simulator view panes vertically:
Figure 86 shows the Client Simulator view panes when they have been arranged vertically.
Figure 86. Arranging Client Simulator view panes vertically
You can arrange a Client Simulator view so that it displays the Input, Result, and Status panes simultaneously from left to right. This view can be helpful when a Client Simulator view is emulating a client that has to handle both event notification and request processing responsibilities.
Do one of the following to arrange the Client Simulator view panes horizontally:
Figure 86 shows the Client Simulator view panes when they have been arranged horizontally.
Figure 87. Arranging Client Simulator view panes horizontally
Request business objects are those that you send from a Client Simulator view when it is emulating a connector that is the source of the events that trigger an interface. Working with request business objects consists of creating a business object instance, populating it with data, and sending the request.
Do the following to create a new business object instance:
When a source client sends a request business object in asynchronous mode, it does not expect to get back a response business object. Once the request business object is dispatched, the source client's role in the transaction is finished. The response business object is typically processed by the integration broker. The default mode for a Client Simulator view is asynchronous.
To send a business object asynchronously, do the following:
When a source client sends a request business object synchronously, it expects to get back a response business object from the integration broker after any destination applications have processed the request.
The business object request is sent to the configured port of the collaboration object chosen for processing.
In batch mode, the Client Simulator view lets you specify the number of instances of a particular business object you want to send, as well as one attribute in the top-level object --a primary key attribute, for example--that you want set to a unique value for each instance. The Client Simulator view copies the business object as many times as you have specified, incrementing the value of the single attribute you specified for each instance, and then sends each instance. This option allows you to create a large number of business objects quickly and easily.
If the selected attribute is a key field that participates in dynamic cross-referencing as part of an identity relationship, then you must guarantee that the initial value and all those that follow it are unique. Otherwise, the cross-referencing logic will fail, causing the request business objects to fail.
To ensure that the values are unique, you can use Relationship Manager or execute SQL statements against the table for the relationship participant as follows.
To send business objects in batch mode, do the following:
The selected attribute should typically be an attribute that uniquely identifies the business object, such as a primary key.
The Client Simulator view generates the number of business objects you specified, all identical with the exception of the one specified attribute, whose value is incremented for each instance.
Figure 88 shows a batch mode configuration in which:
Figure 88. Sending business object requests in batch mode
You can set values for business object attributes when creating a business object request and when editing a business object request that has been received, so that it can be returned as a response.
To set values for the attributes of a business object you intend to send as a request, you must use the Input Pane of the Client Simulator view. For more information, see Using the Input Pane.
To set values for the attributes of a business object you are editing to send as a response, you use the "Response BO" window. For more information, see Editing response business objects.
To provide a value for a simple attribute, click its cell in the Value column of the Input Pane or the "Response BO" window and enter a value.
To add an instance of a child business object, right-click the attribute that represents the child object in the Input Pane or the "Response BO" window and select Add Instance from the context menu.
A plus sign (+) is added next to the attribute that represents the child business object to show that there is at least one child business object instance. If you expand the child object attribute, numbered entries are displayed for each instance. The individual instances also have plus signs (+) next to them, so you can expand them and set values for their attributes.
To add more child business object instances, right-click the attribute that represents the child object and select Add Instance from the context menu.
To remove an instance of a child business object, right-click the instance and select Remove Instance from the context menu.
To remove all instances of a child business object, right-click the attribute that represents the child business object and select Delete All Instances from the context menu.
You can set the verb of a child business object to test the effect that value has on the business process. This can be helpful when you are troubleshooting logic that involves the cross-referencing of child objects.
To set the verb of a child business object instance, right-click it and choose Set Verb from the context menu. When presented with the "Select Verb" prompt, selected the desired verb and click OK.
To reset the attributes of a business object request to their default values, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Edit > Reset BO.
To reset the attributes of a business object response to their default values, click the Reset BO to default button in the toolbar of the "Response BO" window.
To clear the attributes of a business object request of their values, click the down arrow in the right-hand corner of the title bar of the Client Simulator view and select Edit > Clear BO.
To clear the attributes of a business object response of their values, click the Clear BO values button in the toolbar of the "Response BO" window.
Response business objects are those that you send from a Client Simulator view when it is emulating a connector that is the recipient of business object requests in an interface. Working with request business objects consists of editing the values in the business object instance and sending the response back to the server.
If you create and send a business object request as described in Working with business object requests in the Client Simulator view and it is successfully processed by the interface, then the business object appears in the Result Pane of any destination connectors in the interface. Figure 84 shows a Result Pane in which a business object request has been received.
Editing response business objects describes how to edit a business object request that has been received, and Sending response business objects describes how to send the instance as a response.
When you receive a business object request in a Client Simulator view that is emulating a destination client in an interface, you frequently want to edit the values of the attributes. For instance, you will want to provide unique values for primary key attributes that participate in relationships, or you will want to modify the value of other attributes to test map or collaboration logic that responds differently depending on the exact values in the business object. Do the following to set the values of business object attributes:
The ability to import saved data into a business object request is very useful in situations where you have to populate a response business object with data before sending it as a reply. Instead of manually typing a value for each attribute that requires response data, you can type the values once, export the business object (as described in Exporting a response business object), and then import the saved data on subsequent tests.
After you edit a request business object (if editing is needed), you send it back to the server as a reply.
Table 30 lists the reply options and shows their corresponding
connector return codes for both C++ and Java connectors. For more
detailed information about C++ or Java Connector return codes, see the Connector Development Guide for C++ or Connector Development Guide for Java Server.
Table 30. Client Simulator view reply types and connector return codes.
Client Simulator view reply type | C++ connector return code | Java connector return code |
---|---|---|
Success | BON_SUCCESS | SUCCESS |
Fail | BON_FAIL | FAIL |
Multiple Hits | BON_MULTIPLE_HITS | MULTIPLE_HITS |
Retrieve By Content Fail | BON_FAIL_RETRIEVE_BY_CONTENT | RETRIEVEBYCONTENT_FAILED |
Not Found | BON_BO_DOES_NOT_EXIST | BO_DOES_NOT_EXIST |
Value Duplicate | BON_VALDUPES | VALDUPES |
To reply to a request business object, do the following:
You can save a business object instance that you have created in the Input Pane so that it is available whenever the Client Simulator view is opened to emulate that particular connector definition. You can select the instance by name from BO Instance field instead of having to go through the process of creating a new request.
To save the business object instances currently listed in the BO Instance field, click the down arrow on the right-hand side of the title bar of the Client Simulator view and select Edit > Save All BO's.
The business object is saved to a file with the name of the business object instance, without any extension, in a directory named after the business object type in the .bos directory of the directory for the test project in which the test unit is defined. The file is saved in the same format used by Test Connector and Map Designer, so it can be used for testing in those tools as well.
To delete a business object instance from a Client Simulator view, click the down arrow on the right-hand side of the title bar of the Client Simulator view and select Edit > Delete BO.
You can export a business object instance to a file to conveniently archive data and to share with Technical Support. The test data file is saved with a .bo extension and can be used for testing with Test Connector and Map Designer as well as the Integrated Test Environment.
Do the following to export a business object instance from the Input Pane of the Client Simulator view:
Do the following to export a business object instance from the "Response BO" window when editing a business object response in the Result Pane:
You can import a business object test data file that was saved from Map Designer or Test Connector, or exported from Integrated Test Environment.
Do the following to import a business object instance into the Input Pane of the Client Simulator view:
Do the following to import a business object instance into the "Response BO" window when editing a business object response in the Result Pane:
A Client Simulator view can compare two business objects of the same type and display the attributes that differ in value. You can use this function to view changes to a business object at different points in the execution of a transaction. For instance, you could compare a business object that has been sent to the server with the same business object after the server has processed it and returned it to the source connector. Do the following to compare two business object instances:
To transport business object data output, CORBA is used. Because this solution can be problematic if the business object data is large, the server caches the actual business object data locally and notifies the client with metadata only. Since this call is small, the business object inspection points can be updated quickly. The cached data in the server is cleared when the server restarts or when ITE requests it.
Business object data transport is only intended for remote servers. For local servers, sharing the local file system should be used for optimum performance. When business object tracing is turned on, ITE will notify local servers of the file system location. If the server is running remotely, the file system location will be empty.