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 Transformations – XS L variables – New XPATH Get/ S et Header functions – Minimal GUI S upport • Header Based Routing – Uses Filter Expressions Slide 3
One Way Invocation • Request Header • Outbound Header Routing Service Outbound Header Request Header F X Propagate Slide 4
Two Way Request/ Reply Invocation • Inbound Response Header • Response Header Routing Service Inbound Response Header Response Header X Pass-through Slide 5
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 6
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 7
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 8
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 9
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 10
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 11
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 12
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 13
File Header Demo JDeveloper • File to File • Filter routes only if input Filename = ‘Mobile.xml’ • Transform propagates filename to output adapter Slide 14
File Header Demo XPATH Filter Filter Expression ehdr:getRequestHeader('/fhdr:InboundFileHeaderType/fhdr:fileName') = 'Mobile.xml' Slide 15
File Header Demo XS LT XSL Variables Design View INFILENAME, OUTFILENAME Slide 16
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 17
File Header Demo Runtime Slide 18
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 19
Additional Header Info Adapter Namespace In Properties Out Properties XPATH Example http:/ / xmlns.oracle.com/ pcbpel/ adapter/ j ms/ j msAdapterInboundHeader.wsdl j msAdapterOutboundHeader.wsd ('/ j hdr:JMSInboundHeadersAndProper JMS ties/ j hdr:JMSInboundHeaders/ j hdr:J JMS CorrelationID JMS DestinationName MS CorrelationID') = 'HIGH' JMS DeliveryMode JMS DestinationProperties JMS Expiration JMS CorrelationID JMS MessageID JMS Type JMS Priority JMS ReplyTo JMS Redelivered JMS Type JMS Timestamp JMS ReplyTo http:/ / xmlns.oracle.com/ pcbpel/ adapter/ file/ fileAdapterInboundHeader.wsdl fileAdapterOutboundHeader.wsdl ('/ fhdr:InboundFileHeaderType/ fhdr: File fileName') = 'Mobile.xml' filename Filename directory http:/ / xmlns.oracle.com/ pcbpel/ adapter/ aq/ in aqAdapterInboundHeader.wsdl aqAdapterOutboundHeader.wsdl AQ bound/ aqAdapterInboundHeader.xsd aqAdapterOutboundHeader.xsd MessageId Priorit y Priorit y Delay Correlation Expiration Attempts Correlation EnqueueTime RecipientList OrigMessageId ExceptionQueue http:/ / schemas.xmlsoap.org/ soap/ envelope/ Custom Custom ('/ soap:Header/ ns1:country') = ‘ US‘ S OAP Location (‘ / shdr:ES BHeader/ shdr:location’ ) Other adapter examples: S ee BPEL S amples and Adapter OTN Pages Slide 20
Recommend
More recommend