Oracle SOA Suite Enterprise Service Bus Oracle Integration Product - - PowerPoint PPT Presentation
Oracle SOA Suite Enterprise Service Bus Oracle Integration Product - - PowerPoint PPT Presentation
Oracle SOA Suite Enterprise Service Bus Oracle Integration Product Management Oracle ESB Header Support Slide 2 ES B Header S upport Use Cases Files, JMS , AQ, MQ, B2B, Apps Header Transformation Uses XS L
Slide 2
Oracle ESB Header Support
Slide 3
ES B Header S upport
- Use Cases
– Files, JMS , AQ, MQ, B2B, Apps
- Header Transformation
– Uses XS L Transformations – XS L variables – New XPATH Get/ S et Header functions – Minimal GUI S upport
- Header Based Routing
– Uses Filter Expressions
Slide 4
One Way Invocation
- Request Header
- Outbound Header
Routing Service F X Request Header Outbound Header Propagate
Slide 5
Two Way Request/ Reply Invocation
- Inbound Response Header
- Response Header
Routing Service Response Header Inbound Response Header Pass-through X
Slide 6
Header Transformation
- S
upported using XS LT extension functions
- User can read/ get Request headers and Inbound
Response Headers
- User can write/ set Outbound headers and Response
Headers
- Namespace for all the extension functions is :
http://www.oracle.com/XSL/Transform/java/oracle.tip .esb.server.headers.ESBHeaderFunctions
Slide 7
Header Transformation Extension Functions
- 1. String getRequestHeader(String xpathExpression,String namespaceDecl)
- 2. void setOutboundHeader(String xpathExpression,String value, String namespaceDecl)
- 3. String getInboundResponseHeader(String xpathExpression,String namespaceDecl)
- 4. void setResponseHeader(String xpathExpression,String value, String namespaceDecl)
Where, xpathExpression : XPath expression to get/set value : value to be set for the xpathExpression namespaceDecl : namespace declarations in the form ‘prefix=namespace;’
Slide 8
Header Transformation Example
Example: To read ‘ fileName’ header from an inbound file adapter message
// Declare extension function’s namespace in the XSL file as <xsl:stylesheet version="1.0“ …. xmlns:ehdr=http://www.oracle.com/XSL/Transform/java/oracle.tip.es b.server.headers.ESBHeaderFunctions exclude-result-prefixes=“…”> // Read ‘fileName’ from the header <xsl:variable name="GET_INFILENAME" select="ehdr:getRequestHeader( '/fhdr:InboundFileHeaderType/fhdr:fileName', 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;’)” />
Slide 9
Header Transformation Example
Example: To write ‘ fileName’ header to an outbound file adapter message
// Declare extension function’s namespace in the XSL file as <xsl:stylesheet version="1.0“ …. xmlns:ehdr=http://www.oracle.com/XSL/Transform/java/oracle.tip.es b.server.headers.ESBHeaderFunctions exclude-result-prefixes=“…”> // Write ‘fileName’ from the header <xsl:variable name="SET_OUTFILENAME" select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr :fileName', $GET_INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>
Slide 10
Header Based Routing
- S
upported using XPath extension functions
- User can add filters using Request headers and Inbound Response Headers
- S
yntax is same as that for the current filter expressions. { filterExprssion };{ namespaceDeclaration }
- Namespace for all the extension functions is :
http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.E SBHeaderFunctions
- Following XPath extension functions are added
- 1. String getRequestHeader(String xpathExpression)
- 2. String getInboundResponseHeader(String xpathExpression)
Where, xpathExpression : XPath expression to read the header
Slide 11
Header Based Routing Example
Example: To check if ‘ fileName’ read by inbound file adapter message is Payload.xml
// Check if ‘fileName’ from the header is ‘Payload.xml’ // Filter Expression will look like
{ehdr:getRequestHeader('/fhdr:InboundFileHeaderType/fhdr:fileName‘) == ‘Payload.xml’};{ namespace ehdr= http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.E SBHeaderFunctions namespace fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/}
Slide 12
Dynamic S OAP Endpoint Example
Example: To dynamically override the outbound S OAP endpoint, set the Location header to http:/ / localhost:7777/ esb in your XS L as shown below.
ESB XSL CODE <xsl:variable name="LocationIn" select="'http://localhost:7777/esb'" /> <xsl:variable name="LocationOut" select="ehdr:setOutboundHeader('/shdr:ESBHeader/shdr:location', $LocationIn, 'shdr=http://xmlns.oracle.com/esb;')"/>
This functionality requires SOA/ESB 10.1.3.3 or a 10.1.3.1 patch
Slide 13
Known Limitations
- S
et Header() functions support only following types of Xpath expr
– Absolute Path - / Customer/ Address/ Zip – Indexing - / Customer/ Address[2]/ Zip – if Address[1] is not already present in the target document, it will be created. – JMS Custom properties supported with the following syntax
- Get “ Property[position()=1]/@name”
- S
et “ Property[@name="Country"]/@value”
– Get and S etHeader functions used inside XS L must not have opaque inputs/ outputs
- Limited S
OAP support
– ‘ Header’ element will be set as header – User has to use XPath expressions starting with header element –
- eg. ‘ / Header/ Message/ Priority’
- Limited Tooling support
Slide 14
File Header Demo JDeveloper
- File to File
- Filter routes only if input Filename = ‘Mobile.xml’
- Transform propagates filename to output adapter
Slide 15
File Header Demo XPATH Filter
Filter Expression
ehdr:getRequestHeader('/fhdr:InboundFileHeaderType/fhdr:fileName') = 'Mobile.xml'
Slide 16
File Header Demo XS LT
XSL Variables Design View
INFILENAME, OUTFILENAME
Slide 17
File Header Demo XS LT
XSL Variables Source View
INFILENAME, OUTFILENAME
… <xsl:variable name="INFILENAME" select="ehdr:getRequestHeader('/fhdr:InboundFileHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/> <xsl:variable name="OUTFILENAME" select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr:fileName', $INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/> …
Slide 18
File Header Demo Runtime
Slide 19
File Header Demo Instructions
1 – Unzip ESBHeader.zip from “training\sampledata” folder to c:\temp 2 – Start JDeveloper 3 – Select existing ESBSamples project 4 - Open “C:\temp\ESBheader\HeaderSupportDemo\HeaderSupportDemo.jpr” 5 – Register with ESB Server 6 – Observe new service metadata in ESB Console under System “TVox” 6 – Copy C:\temp\ESBheader\*.xml files to C:\temp\ESBheader\in 7 – Observe both files deleted but only Mobile.xml in Out dir 8 – View in ESB console Instance data Note: The C:\temp location is hard coded in both adapters. You can unzip to another location and then run the file adapter wizards to change the location.
Slide 20
Additional Header Info
Adapter Namespace In Properties Out Properties XPATH Example
JMS
http:/ / xmlns.oracle.com/ pcbpel/ adapter/ j ms/ j msAdapterInboundHeader.wsdl
JMS CorrelationID JMS DeliveryMode JMS Expiration JMS MessageID JMS Priority JMS Redelivered JMS Type JMS Timestamp JMS ReplyTo
j msAdapterOutboundHeader.wsd
JMS DestinationName JMS DestinationProperties JMS CorrelationID JMS Type JMS ReplyTo
('/ j hdr:JMSInboundHeadersAndProper ties/ j hdr:JMSInboundHeaders/ j hdr:J MS CorrelationID') = 'HIGH'
File
http:/ / xmlns.oracle.com/ pcbpel/ adapter/ file/ fileAdapterInboundHeader.wsdl
filename directory
fileAdapterOutboundHeader.wsdl
Filename
('/ fhdr:InboundFileHeaderType/ fhdr: fileName') = 'Mobile.xml'
AQ
http:/ / xmlns.oracle.com/ pcbpel/ adapter/ aq/ in bound/ aqAdapterInboundHeader.wsdl aqAdapterInboundHeader.xsd
MessageId Priorit y Correlation Attempts EnqueueTime OrigMessageId
aqAdapterOutboundHeader.wsdl aqAdapterOutboundHeader.xsd
Priorit y Delay Expiration Correlation RecipientList ExceptionQueue
S OAP
http:/ / schemas.xmlsoap.org/ soap/ envelope/ Custom Custom Location ('/ soap:Header/ ns1:country') = ‘ US‘ (‘ / shdr:ES BHeader/ shdr:location’ )
Other adapter examples: S
ee BPEL S amples and Adapter OTN Pages