Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space FUNCTDEV and version SVC2024.1

...

If a matching row is found, then that row will be used for any parameterized values in the Message Stub Response message. This way, the stub can respond with the desired message values based on values in the incoming messages. 

Attachment Options

The Attachment tab allows you to send either Binary or XML attachments without scripting. To send an attachment, perform the following from the Attachment tab:

  1. Click Add. An XML Attachment entry appears in the Attachment table.
  2. Double-click the XML Attachment entry. An Edit Attachments dialog opens.
  3. In the Edit Attachments dialog, select either XML or Binary from the Mode menu.

The following option is available for XML Mode:

  • Views: Select the desired view from the menu and configure accordingly. Options are Literal XML, Form XML, Scripted XML, and Form Input.

The following options are available for Binary Mode:

  • Base 64 Encoding: Enables Base 64 Encoding to encode the binary value.
  • Data Source Column: Select to send values from a data source column.
  • File: Select to send values from a file. Choose the desired file by clicking Browse. Enable Persist as Relative Path if you want the path to this file to be saved as a path that is relative to the current configuration file.
  • Text: Select to send a text value.
  • Content type: Specify the content type. Click Edit Headers if you want to add, modify, or delete attachment headers.

Service Options

The Service Options tab allows you to configure how the message is processed. The following options are available:

  • Message Exchange Pattern: Select Solicit Response or Notification Only.
  • Return Status: Allows you to specify how the message is returned, for instance, to emulate working or faulty services. To use the default value of 200 OK, enable Use Default Return Status. If this option is not enabled, the following options are available:
    • Return Status: Enter the custom return status value. If a data source is available, you can also parameterize this value.
    • Skip message proxy failoverEnable to bypass the message proxy's failover setting for internally routed error messages and send the custom return status configured in the response.

  • Request Handling: Select Apply incoming request tools on the message before responding if you need the request message to be transformed before it is processed by the Data Source Correlation or Multiple Responses "if request matches" condition logic. This is important when the XML must be altered to make it suitable for correlation, or if the message is not XML at all and requires some transformation before the stub sends the original caller a suitable response for the request.
  • Performance: The Performance tab enables you to set the following options related to the execution time:
    • Timeout after (milliseconds): Specifies the length of delay (in milliseconds) after which SOAtest should consider the message to be timed out. The Default setting is 30000. The Custom setting allows you to enter a timeout. A non-positive timeout value can be entered to specify an infinite timeout.
      • Fail the test on timeout: Select this option to fail the test on the specified timeout.
      • Pass the test only if a timeout occurred: Select this option to pass the test if the specified timeout occurred (that is, test did not finish execution within the specified time).
    • Think time (ms): Enter the amount of time (in milliseconds) for the message delay you want to emulate. This can be used to emulate a slow service. If a data source is available, you may also parameterize this value. A think time value larger than the Timeout value will not force a timeout. Timeouts will only occur if a message is not correlated successfully and the Message Stub is idle and unable to complete.
  • Style/Use: These options allow you to select the body style and encoding of the message:
    • Body Style: Select either document or rpc.
    • Use: Select either encoded or literal.
    • Encoding Style URI (Automatically completed if available): Lists the encoding style URI used to send requests.
    • Target Object URI: Specifies the target object URI.
  • Attachment Encapsulation Format: Specifies whether to use the Default or Custom encapsulation format. The Default option specifies whatever is chosen as the Attachment Encapsulation Format in the SOAP Client tab of the Preferences panel (for more information, see SOAP Settings). The Custom option allows you to choose MIMENone, DIME, MTOM Alwaysalways, or MTOM Optionaloptional.
  • Headers: Allows you to add custom headers in the response.

...

  1. Enter a service definition in the in the Definition tab of the Message Stub tool.
  2. Right-click the Message Stub node and choose Add Output. The Add Output wizard opens.
  3. From the Add Output wizard, select Incoming Request from the left pane and XML Data Bank from the right pane, then click Finish.
  4. Double-click the Incoming Request> XML Data Bank node beneath the Message Stub node. The XML Data Bank configuration panel displays in the right GUI panel.
  5. In the right GUI panel, add the XPath of the value you want to access in your script.
  6. Double-click the Message Stub node. The Message Stub configuration panel displays in the right GUI panel.
  7. In the Response tab, choose the Scripted view.
  8. Enable the Use Data Source option.
  9. Specify your logic. The following is the basic template for accessing data source and data bank values:

    Code Block
    def customLogic(context):
        # Retrieve the data source value. "Data Source Name" should be replaced
        # with the name of your data source and "Column Name" should be the column
        # that your value is coming from. You can access many columns from the same
        # data source within this script. For Data Bank values, the table is always
        # named "Generated Data Source" so you only need to replace "Data Bank Column Name"     
        dataSourceValue = context.getValue("Data Source Name", "Column Name")     
        dataBankValue = context.getValue("Generated Data Source", "Data Bank Column Name")     
        # add custom logic that uses value from data source

    Image Modified

  10. Select the correct method from the Method menu. The method you select should be your entry point. In the above example, the method would be customLogic().

...