What You May Need to Know About the Assign Activity

19-28 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite ■ The following activities happen while assigning a source child node to a target child node: 1. The source child node name and namespace are overwritten by the target node name and namespace, respectively. 2. The target child node is replaced by the source child node in the parent node of the target node.

19.2.2.11 How to Access Headers for Filters and Assignments

When the Expression Builder is invoked from an Oracle Mediator, either for defining a filter or for defining an assignment source or target, the WSDL file is parsed. This automatically detects any SOAP headers for the current routing rule operation and makes them visible as variables under the in or out folder as header.ns_ elementName, as shown in Figure 19–24 . Here, ns is the namespace prefix and elementName is the root element name for the header schema. The following examples provide details. Example 1: Namespace Prefixes wsse and ns1 Are Already Defined Assume the namespace prefixes wsse and ns1 are already defined in the WSDL file or the .mplan file. You can then write an XPath expression as follows: in.header.wsse_Securitywsse:Securityns1:FooPriority Example 2: Schema Without a Namespace Predefined in the WSDL File Assume you want to use a schema that does not have a namespace predefined in the WSDL file. The Expression Builder is then enhanced to allow you to enter {full_ namespace} instead of a prefix. The Expression Builder then generates a unique prefix and the prefix definition is added to the .mplan file. For example, enter the expression in the Expression Builder shown in Example 19–12 : Example 19–12 Expression in.header.{http:docs.oasis-open.orgwss200401oasis-200401-wss-wssecurity-sec ext-1.0.xsd}_Security {http:docs.oasis-open.orgwss200401oasis-200401-wss-wssecurity-secext-1.0.xs d}: Security{http:www.globalcompany.comnsOrderBooking}:FooPriority The .mplan file contains the content shown in Example 19–13 . Example 19–13 Contents of .mplan File xmlns:ns1=http:docs.oasis-open.orgwss200401oasis-200401-wss-wssecurity- secext-1.0.xsd xmlns:ns2=http:www.globalcompany.comnsOrderBooking ... expression=in.header.ns1_Securityns1:Securityns2:FooPriority Creating Oracle Mediator Routing Rules 19-29 Figure 19–24 Expression Builder Dialog - Automatic Header Detection By default, SOAP headers are not passed through by Oracle Mediator. You must add the passThroughHeader endpoint property to the corresponding Oracle Mediator routing service: property name=passThroughHeadertrueproperty For example, to add this property, you can modify the composite.xml file, as shown in Example 19–14 . Example 19–14 passThroughHeader Property component name=Mediator1 implementation.mediator src=Mediator1.mplan property name=passThroughHeadertrueproperty component For the headers to pass through, the source and the target must have the same QName name and namespace. If the source and the target have different QNames, then either a transformation or part-level assignment must be performed. It is important to note that, with a passthrough Oracle Mediator without a transformation or assign, if the source and target part QNames are not identical, then Oracle Mediator passes through the message payloads to the target service without any error. However, this can result in an error in the target service because the message payloads are not reconstructed according to the message structure of the target service. 19-30 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

19.2.2.11.1 Manual Expression Building for Accessing Headers for Filters and Assignments

There are use cases in which the header schemas cannot be determined from the WSDL files. For example, security headers that are appended to a message, or the headers for an Oracle Mediator that are created using an abstract WSDL file. To access these headers, you must manually enter the XPath expression into the Expression Builder. The syntax for header expressions is shown in Example 19–15 . Example 19–15 Header Expressions Syntax in.header.header root element namespace prefix_header root element namexpath Therefore, for the header shown in Example 19–16 . Example 19–16 Header Syntax wsse:Security xmlns:wsse=http:docs.oasis-open.orgwss200401oasis-200401-wss-wssecurity-sec ext-1.0.xsd Priority234Priority wsse:Security The filter expression is as follows: in.header.wsse_Securitywsse:SecurityPriority = 234 The assignment expression is as shown in Example 19–17 . Example 19–17 Assignment Expression copy target=out.property.jca.jms.priority expression=in.header.wsse_Securitywsse:SecurityPriority For the preceding expressions to work, you must add the attribute shown in Example 19–18 to the root element of the .mplan file. Example 19–18 Addition of Attribute to .mplan File wsse = http:docs.oasis-open.orgwss200401oasis-200401-wss-wssecurity- secext-1.0.xsd

19.2.2.11.2 Manual Expression Building for Accessing Properties for Filters and Assignments

An example of a filter expression is as follows. in.property.tracking.ecid = 2 An example of an assignment expression is as follows. Notes: ■ The user interface supports both SOAP 1.1 and SOAP 1.2. ■ For automatic header detection, a concrete WSDL file must be used when creating the Oracle Mediator service component. ■ Assignments execute after filters. Therefore, if you are assigning a value in a custom header, then the particular assignment is not visible to the filter. Creating Oracle Mediator Routing Rules 19-31 copy target=out.property.tracking.ecid value=in.property.tracking.ecid

19.2.2.12 How to Use Semantic Validation

You can specify Schematron files for validating an inbound message and its various parts. Schematron version 1.5 is the supported version. Perform the following steps for specifying a Schematron schema to validate an inbound message and its various parts. To use semantic validation: 1. To the right of the Validate Semantic field, click the Select Validation File icon. The Validations dialog is displayed.

2. Click Add.

The Add Validation dialog is displayed.

3. From the Part list, select a message part.

4. To the right of the File field, click Search.

The SOA Resource Browser dialog is displayed.

5. Select a Schematron file and click OK.

The Add Validation dialog is updated, as shown in Figure 19–25 . Figure 19–25 Add Validation Dialog

6. Click OK.

The Validation dialog is updated, as shown in Figure 19–26 . Notes: ■ Schematron files usually have a .sch extension. ■ No error message or warning is displayed if the selected Schematron file is empty.