This chapter describes how to test services using the Oracle Service Bus (OSB) Test Console from the OSB Administration Console.
The Oracle Service Bus Test Console is a browser-based test environment used to validate and test the design of your system. You can configure the object of your test (proxy service, business service, or resource), execute the test, and view the results in the Test Console. In some instances, you can trace through the code and examine the state of the message at specific trace points. To learn more about the Test Console, see "Using the Test Console" in the Oracle Fusion Middleware Administrator's Guide for Oracle Service Bus.
Only users in the IntegrationAdmin
and IntegrationDeployer
roles can use the Test Console. For more information about roles, see "Roles in Oracle Service Bus" in the Oracle Fusion Middleware Administrator's Guide for Oracle Service Bus.
Note:
If you receive an error saying the Test Console service is not running, try setting the Admin server listen address to a specific valid address, such as localhost. In the Oracle WebLogic Server Console, go to Environment > Servers > admin_server_name > Configuration > General to set the Listen Address.This chapter contains the following sections:
This section includes the following topics:
You can test the following types of proxy services: any XML, any SOAP, Messaging, XML, and SOAP. You can test SOAP proxy services with Web Service Security (WSS) policies. See Web Service Security in Section 33.1.2, "Configuring Proxy Services Test Data."
Note:
When the Test Console invokes a proxy with HTTP custom token authentication, the authentication check is not done.Caution:
Testing proxy services with the direct call option enabled bypasses some important security steps, including access control. Oracle recommends that you not use the test framework in production systems. For information on undeploying the Test Console, see Section 40.11, "Undeploying the Test Console."Click Activate under Change Center to enable the test feature in the Test Console.
You can test proxy services from the Resource Browser or Project Explorer.
Select Resource Browser > Proxy Services to display the Summary of Proxy Services page.
Under Actions, click the Launch Test Console icon associated with the proxy service you want to test.
The Test Console opens the Proxy Service Testing page. For example, using the examples provided with the product, click the icon associated with the LoanGateway1
proxy service.
Note:
In a clustered domain, you cannot use the Test Console to test any configured business service or proxy service which routes to a business service.For SOAP and XML services, select the WSDL operation you want to test.
Configure the test data for the proxy service. This must be the data that the proxy service expects from the client.
By default, both test configuration options, Direct Call and Include Tracing, are enabled. You can clear the Direct Call option, which also clears the Include Tracing option. By doing so, testing is performed using the indirect call method where the message is sent through the transport layer.
You can use the Direct Call option (leave Direct Call selected) and disable Execution tracing; simply clear the Include Tracing check box.
To see message tracing, clear Direct Call.
Note:
To see tracing in the log file or standard out (server console), Oracle WebLogic Server logging must be set to the following severity levels:Minimum severity to log: Info
Log file: Info
Standard out: Info
For information on setting log severity levels, see "Using Log Severity Levels" in Oracle Fusion Middleware Configuring Log Files and Filtering Log Messages for Oracle WebLogic Server.
Click Execute. The Proxy Service Testing page displays the results. For information about interpreting the test results, see Section 33.1.3, "Viewing Proxy Services Test Results."
To run the test again, click Back. Repeat steps 5 and on.
Table 33-1 lists the configuration options for testing proxy services. The fields for accepting input to the request document are based on the service type.
Table 33-1 Proxy Services Configuration Options
Section | Options/Fields |
---|---|
Name |
The name of the proxy service being tested. |
Available Operations |
Operations associated with the proxy service. |
Test Console Actions |
|
Test Configuration |
Set the testing configuration options.
|
Request Document |
The input fields generate the request message that is sent to the proxy service. Click Execute to run the test with the values you entered. The Test Console displays the request message and the service's response message and metadata. Input in the Request Document section is service-type specific. The service types and a description of the input required by each are listed in the following sections.
|
Web Service Security |
This section is available only for SOAP services when the selected operation has a Web Service Security (WSS) policy.
|
Transport |
The Transport section is collapsed by default. The fields and values depend on the test configuration. |
Authentication |
|
Invocation Mode |
Request/Response - This option is only displayed when testing any SOAP or any XML proxy service. Clear the Request/Response check box for one-way service invocations. |
Message Metadata |
See Table 33-10 |
Transport Headers |
See Table 33-10 |
Note:
The secured SOAP message is displayed printed with extra white spaces. Because white spaces can affect the semantics of the document, this SOAP message cannot always be used as the literal data. For example, digital signatures are white space-sensitive and can become invalid.Table 33-2 describes proxy service testing results. Tracing is only enabled if you have selected both the Direct Call and the Include Tracing options.
Table 33-2 Testing Results for Proxy Services
Section | Description |
---|---|
Proxy Service Name |
The name of the proxy service that is being tested. |
Test Console Actions |
Back displays the previous browser page. Close closes the Test Console. |
Request Document |
The request message sent to the proxy service by the Test Console. This section is initially collapsed if the Test Console did not modify the request message. This section is initially expanded for SOAP services configured using the Form tab, or if WS-Security has been applied. If WS-Security has been applied, this section will contain two SOAP messages—the first message is the clear text message; the second is the secured SOAP message. |
Response Document |
The message response. For a SOAP service with a WS-Security response, this section contains two SOAP messages. The first SOAP message is the secured message as received by the client. The second SOAP message is the corresponding clear text message. |
Response Metadata |
The metadata retuned with the message response. |
Tracing shows the state of the message as it passes through the system. When the Direct Call option is not selected, tracing is not performed. For more information on tracing, see Section 33.1.4, "Tracing Proxy Services" |
Tracing is enabled when you test proxy services using a direct call. The Include Tracing check box is selected by default with the Direct Call option. If you do not want tracing, clear the Include Tracing check box. When you enable tracing, the test results include the details of the trace. Use tracing to track problems in the system and to isolate them for correction. The trace information shows the path taken through the request and response paths in the code.
Click Activate under Change Center to enable the test feature in the Administration Console.
Select Resource Browser > Proxy Services to display the Summary of Proxy Services page.
Under Actions, click the Launch Test Console icon associated with the service you want to test. The Test Console opens the Proxy Service Testing page.
Configure the test data for the proxy service. You must have the Direct Call and Include Tracing options selected to enable tracing. See Section 33.1.2, "Configuring Proxy Services Test Data."
Click Execute. The Proxy Service Testing page displays the test results for the service and the tracing information.
Scroll down to the Invocation Trace section.
This section displays a graphical representation the message flow. You can trace the message through the service and view the state of the message at pre-selected points in the trace. The trace points are automatically set.
Click the + plus sign to expand the message flow to view more detail.
While viewing the trace you can also view the message flow in the Oracle Service Bus Administration Console. This helps you relate the trace to the stages and actions in the message flow. You can modify the message flow and run the trace again to view the output.
You can test the following types of business services: any XML, any SOAP, Messaging, XML, and SOAP. You can test SOAP business services with Web Service Security policies. For more information, see "Testing Services with Web Service Security" in the Oracle Fusion Middleware Administrator's Guide for Oracle Service Bus.
Note:
In a clustered domain, you cannot use the Test Console to test any configured business service or proxy service which routes to a business service.Click Activate under Change Center to enable the test feature in the Administration Console.
Select Resource Browser > Business Services to display the Summary of Business Services page.
Under Actions, click the Launch Test Console icon associated with the service you want to test. The Test Console opens the Business Service Testing page. For example, using the tutorials provided with the product, click the icon associated with loanSaleProcessor.
For SOAP and XML services, select an operation from the Available Operations field.
Configure the test data for the business service (the input data should be the message being sent by the proxy service to the business service). The Direct Call and Include Tracing options that are available when testing proxy services are not available for business services. By default, business services are tested using the Direct Call option, meaning that the messages pass through the transport layer.
To see message tracing, clear Direct Call.
Note:
To see tracing in the log file or standard out (server console), Oracle WebLogic Server logging must be set to the following severity levels:Minimum severity to log: Info
Log file: Info
Standard out: Info
For information on setting log severity levels, see "Using Log Severity Levels" in Oracle Fusion Middleware Configuring Log Files and Filtering Log Messages for Oracle WebLogic Server.
Click Execute.
The Business Service Testing page displays the results. For more information, see Section 33.1.7, "Viewing Business Services Test Results."
This section describes how to use the Test Console to test attachments on business services.
For illustration purposes, this section assumes that a WSDL-based HTTP business service uses a "submitAttachment" operation to send a ZIP file as an attachment in a SOAP message. Modify the settings as appropriate for different types of binary attachments.
In the Test Console for the business service, go to the XML page and enter the following SOAP Envelope for the test message:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <m:submitAttachment xmlns:m="http://www.alsb.com/SOAPwithAttachment/"> <submitAttachment> <fileName>c:\yourfile.zip</fileName> </submitAttachment> <zipFile href="cid:zipFile"/> </m:submitAttachment> </env:Body> </env:Envelope>
In the Attachment section of the Test Console:
Content-Type: application/zip (as defined in the WSDL)
Content-ID: zipFile (must match the value of href="cid:zipFile" in the test message)
File: Click Browse, and select the ZIP file you specified in the SOAP Envelope.
Click Add.
Click Execute to send the test message with the attachment.
To confirm success of the sent attachment, check the server console for a message similar to the following, which is logged by the submitAttachment operation:
WS called - received the following properties: submitAttachment is: com.alsb.soapwithattachment.SubmitAttachmentRequestType@e2abb0 zipFile is: javax.activation.DataHandler@175cf0a
Table 33-3 lists the configuration options for testing business services. The fields for accepting input to the request document are based on the service type.
Table 33-3 Business Services Configuration Options
Section | Options/Fields |
---|---|
Name |
The name of the business service being tested. |
Available Operations |
Operations associated with the business service. |
Test Console Actions |
|
Request Document |
The input fields generate the request message that is sent to the business service. Click Execute to run the test with the values you entered. The Test Console displays the request message and the service's response message. Input in the Request Document section is service-type specific. The service types and a description of the input required by each are listed in the following sections.
|
Web Service Security |
This section is available only for SOAP services when the selected operation has a Web Service Security policy.
|
Transport |
The Transport section is collapsed by default. The fields and values depend on the test configuration. |
Authentication |
|
Invocation Mode |
Request\Response - This option is only displayed when testing an any SOAP or any XML business service. Clear the Request/Response check box for one-way service invocations. |
Message Metadata |
See Table 33-10 |
Transport Headers |
See Table 33-10 |
Table 33-4 describes business service testing results.
Table 33-4 Testing Results for Business Services
Section | Description |
---|---|
Business Service Name |
The name of the business service. |
Test Console Actions |
Click Back to display the previous browser page. Click Close to close the Test Console window. |
Request Document |
The request message sent to the business service by the Test Console. This section is initially collapsed if the Test Console did not modify the request message. This section is initially expanded for SOAP services configured using the Form tab, or if WS-Security has been applied. If WS-Security has been applied, this section will contain two SOAP messages. The first message is the clear text message. The second is the secured SOAP message. |
Response Document |
The message response. For a SOAP service with a WS-Security response, this section will contain two SOAP messages. The first SOAP message is the secured message as received by the client. The second SOAP message is the corresponding clear text message. |
Response Metadata |
The metadata returned with the message response. |
Note:
The secured SOAP message is displayed pretty printed, for example, with extra white spaces. This SOAP message cannot always be used as the literal data as white spaces can affect the semantics of the document. For example, digital signatures are white space-sensitive and can become invalid.You can test transformations after activating a session or during a session to ensure that the resources operate with the expected behavior. You must activate the session to test the runtime, otherwise the testing is done at design time using your local changes.
You can test the following transformations:
A Message Format Language (MFL) document is a specialized XML document used to describe the layout of binary data. MFL resources support two transformations. Each transformation only accepts one input and provides a single output: XML to binary, or binary to XML.
Table 33-5 describes MFL configuration options.
Table 33-5 Configuring MFL Options
Section | Description |
---|---|
Name |
The name of the resource being tested. |
Supported transformations |
To select a specific transformation, select the transformation name. |
Test Console Actions |
|
MFL Transformation Configuration |
|
You can test the design time or the runtime.
Click Activate to test the runtime. Do not activate the session to test the design time.
Select Resource Browser > MFLs to display the Summary of MFL Files page.
Under Actions, click the Launch Test Console icon associated with the resource you want to test. The Test Console opens the Resource Testing page.
Select the transformation you want to test.
Configure the test data for the MFL resource. For more information, see Table 33-5.
Click Execute. The Resource Testing page displays the results.
To retest, click Back. You can close the Test Console, modify, and retest the resource.
eXtensible Stylesheet Language Transformations (XSLT) describe XML-to-XML mappings in Oracle Service Bus. To test an XSLT resource you must supply the input XML document and the Test Console returns the output XML document. XSLT transformations may have additional named parameters. All parameters required by the transformation are displayed on the configuration page. Default values are available but you can override them.
Table 33-6 describes XSLT configuration options.
Table 33-6 Configuring XSLT Options
Section | Description |
---|---|
Name |
The name of the resource being tested. |
Test Console Actions |
|
Input and Parameters |
The input document and parameters for testing the XSLT resource.
|
You can test the design time or the runtime.
Click Activate to test the runtime. Do not activate the session to test the design time.
Select Project Explorer > XSLTs to display the Summary of XSLTs page.
Under Actions, click the Launch Test Console icon associated with the resource you want to test. The Test Console opens the Resource Testing page.
Configure the test data for the resource in the Input and Parameters section of the page. For more information, see Table 33-6.
Click Execute. The Resource Testing page displays the results.
To retest, click Back. You can close the Test Console, modify, and retest the resource.
XQuery maps can describe XML-to-XML, XML to non-XML, and non-XML to XML mappings. An XQuery transformation can take multiple inputs and returns one output. Each input corresponds to an XQuery external variable declared in the XQuery resource. The value of an XQuery input variable can be a primitive value (String, integer, date, and so on), an XML document, or a sequence of these types. The output value can be a primitive value (String, integer, date, and so on), an XML document, or a sequence of these types.
Note:
The Test Console does not support sequences on input.Table 33-7 describes XQuery configuration options.
Table 33-7 Configuring XQuery Options
Section | Description |
---|---|
Name |
The name of the resource being tested. |
Test Console Actions |
|
Variables |
This section contains one input field for each of the XQuery external variables. <param_name> ([] as XML) - In the Test Console, a single-line edit box is displayed if the type is a simple type. A multi-line edit box is displayed if the data is XML. A combination input ( An XML input can be file-based or text-based. Referencing a file for input takes precedence over textual input. Browse and select the file you want to use in your test. Input in the Test Console is rendered based on the type to make it easier to understand the type of data you must enter. When untyped, the default type is XML. |
You can test the design time or the runtime.
Click Activate to test the runtime. Do not activate the session to test the design time.
Select Project Explorer > XQueries to display the Summary of XQueries page.
Under Actions, click the Launch Test Console icon associated with the resource you want to test. The Test Console opens the Resource Testing page.
Configure the test data for the resource in the Variables section of the page. For more information, see Table 33-7.
Click Execute. The Resource Testing page displays the results.
To retest, click Back. You can close the Test Console, modify, and retest the resource.
You can edit and test an action in the message flow using the following Editors: XQuery Expression Editor, XQuery Condition Editor, and XPath Expression Editor. Testing takes the same form for both the XQuery Expression and Condition Editors. However, the scenario is different for the XPath Expression Editor because it takes only one input.
Note:
You must disable the pop-up blockers in your browser for XQuery testing to work. If you have toolbars in the IE browser, you may need to disable the pop-up blockers from under the Options menu as well as for all toolbars that are configured to block them.This section includes the following topics:
You use XQuery expressions to create the data content for the message context variables (or part of a message context variable) during the execution of the message flow. You can use the Test Console directly in the XQuery Expression Editor to test the definition of the expression.
Similarly, you use XQuery conditions to evaluate Boolean conditions in the message flow. You can use the Test Console directly in the XQuery Condition Editor to test the definition of the condition.
An XQuery can take multiple inputs and returns one output. Each input corresponds to an XQuery unbound variable defined in the XQuery. The value of an XQuery input can be a primitive value (String, integer, date, and so on), an XML document, or a sequence of these types. The output value can be a primitive value (String, integer, date, and so on), an XML document, or a sequence of these types.
Note:
The Test Console does not support sequences on input.Table 33-8 describes XQuery configuration options.
Table 33-8 Configuring XQuery Testing
Section | Description |
---|---|
Name |
The type of expression being tested. |
Test Console Actions |
|
Variables |
This section contains one input field for each of the XQuery unbound variables. <param_name> ([] as XML) - param_name is the name of the corresponding XQuery unbound variable. In the Test Console, a single-line edit box is displayed if the type is a simple type. A multi-line edit box is displayed if the data is XML. A combination input (<param_name> ([] as XML)) is used when the variable is not typed.You must declare the variable type. Select the check box to identify a parameter of type XML. An XML input can be file-based or text-based. Referencing a file for input takes precedence over textual input. Browse and select the file you want to use in your test. Input in the Test Console is rendered based on the type to make it easier to understand the type of data you must enter. The default type is XML. |
Access the Test Console when editing an action in the message flow of a pipeline.
To access the XQuery Expression Editor, see Section 23.1, "Creating and Editing Inline XQuery and XPath Expressions."
To access the XQuery Condition Editor, see Section 23.1, "Creating and Editing Inline XQuery and XPath Expressions."
The XQuery Testing Expression page is displayed. All input variables requested are displayed on the page.
Configure the test data for the XQuery in the Variables section of the page. For more information, see Table 33-8.
Click Execute. The testing page displays the results.
Once you have completed a test, you can click Back to execute a new test. To execute a new test after making changes to the XQuery, you must close and reopen the Test Console for the changes to take effect.
You use XPath expressions to select a subset of an XML message context variable. You can use the Test Console in the XPath Expression Editor to test the definition of the XPath expression. An XPath expression takes a single XML document as input and generates a sequence of XML documents, primitives types, or both as output.
Table 33-9 describes XPath expression configuration options.
Table 33-9 Configuring XPath Options
Section | Description |
---|---|
Name |
The type of expression being tested. |
Test Console Actions |
|
Variables |
This section contains a single input field corresponding to the XML document against which this XPath expression is being tested. The XML input can be file-based or text-based. Referencing a file for input takes precedence over textual input. Browse and select the file you want to use in your test. |
Access the Test Console when editing an action in the message flow of a pipeline. To access the XPath Expression Editor, see Section 23.1, "Creating and Editing Inline XQuery and XPath Expressions."
Configure the test data for the XPath expression in the Variables section of the page. For more information, see Table 33-9.
Click Execute. The testing page displays the results.
Once you have completed a test, you can use the Back button to execute a new test. To execute a new test after making changes to the XPath expression, you must close and reopen the Test Console for the changes to take effect.
Section 33.1.2, "Configuring Proxy Services Test Data" and Section 33.1.6, "Configuring Business Services Test Data"
describe how you configure the values of the transport headers, transport metadata, and transport-related security data for outbound requests when you test proxy services or business services in the Test Console. However, some specifications you can make in the Test Console are not honored at runtime. That is, the values of certain headers or metadata are overwritten, or ignored by the Oracle Service Bus at runtime when the test is executed. The headers and metadata for which there are limitations are described in Table 33-10
.
Table 33-10 Limitations to Transport Header and Metadata Values You Specify in the Test Console When Testing a Service
Transport | Service Type | Description of Limitation | Transport Headers Affected |
---|---|---|---|
HTTP(S)Foot 1 |
Proxy Services |
All transport headers and other fields you set are preserved at runtime. This is true whether or not the Direct Call option is set. |
All |
HTTP(S) |
Business Services |
The Oracle Service Bus runtime overrides any values you set for these parameters. |
Content-Length Content-Type relative-URI client-host client-address |
JMS |
Proxy Services |
When the Direct Call option is used, all transport headers and other fields you set are preserved at runtime. |
All |
JMS |
Proxy Services |
When the Direct Call option is not used, the same limitations apply as those for a transport header action configuration. |
See the limitations for JMS transport headers described in "Limitations to Transport Header Values You Specify in Transport Header Actions" |
JMS |
Business Services |
The same limitations apply as those for a transport header action configuration. |
See the limitations for JMS transport headers described in "Limitations to Transport Header Values You Specify in Transport Header Actions" |
|
Proxy Services |
No limitations. Any transport headers and other fields you set are honored at runtime. This is true whether or not Direct Call is specified. |
None |
|
Business Services |
The Oracle Service Bus runtime overrides any values you set for these parameters |
Content-Type |
File |
Proxy Services |
No limitations. Any transport headers and other fields you set are honored at runtime.Foot 2 |
None |
File |
Business Services |
No limitations |
None |
FTP |
Proxy Services |
No limitations. Any transport headers and other fields you set are honored at runtime. |
None |
FTP |
Business Services |
No limitations |
None |
Footnote 1 When you test proxy services, the Test Console never sends a HTTP request over the network, therefore transport-level access control is not applied.
Footnote 2 For example, FileName (Transport metadata)—the value you assign is appended to the output file name. For example, 1698922710078805308-b3fc544.1073968e0ab.-7e8e-{$FileName}.