Académique Documents
Professionnel Documents
Culture Documents
SOALair
SOAExplained
3DaysTutorialinOSB
1.TableofContents
1.SERVICEORIENTEDARCHITECTURE.3
2.INTEGRATIONARCHITECTURE.5
3.HUBANDSPOKEINTEGRATIONARCHITECTURE.5
4.DISTRIBUTEDINTEGRATIONARCHITECTURE.7
5.SERVICEORIENTEDARCHITECTURE(SOA)8
6.EXTENSIBLEMARKUPLANGUAGE.9
7.WEBSERVICEDESCRIPTIONLANGUAGE.10
8.ORACLESERVICEBUS.14
8.1.Bus,whatBus?.14
8.2.ResourcesinOracleServiceBus.17
8.3.ProxyServicesandBusinessServices.18
8.4.MessageFlowsandPipelines.19
8.5.PipelinePairs.19
8.6.MessageFlowComponents.20
8.7.BuildingaMessageFlow..22
8.8.MessageExecution.22
8.9.BranchinginMessageFlows.23
8.9.1.OperationalBranching.23
8.9.2.ConditionalBranching.23
8.10.ConguringActionsinStagesandRouteNodes.24
8.10.1.CommunicationActions.24
8.10.2.FlowControlActions.25
8.10.3.MessageProcessingActions.26
8.10.4.ReportingActions.26
8.11.ConguringTransportHeadersinMessageFlows.27
8.11.1.ConguringGlobalPassThroughandHeaderSpecicCopyOptionsforTransportHeaders27
8.11.1.1.UnderstandingHowtheRunTimeUsestheTransportHeadersSe ings.28
8.12.PerformingTransformationsinMessageFlows.30
8.13.TransformationsandPublishActions.31
8.14.TransformationsandRouteNodes.31
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 1/45
5/9/2017 3DaysTutorialinOSB|SOALair
8.14.TransformationsandRouteNodes.31
8.15.ConstructingServiceCalloutMessages.31
8.16.SOAPDocumentStyleServices.32
8.17.SOAPRPCStyleServices.33
8.18.XMLServices.35
8.19.MessagingServices.35
8.20.HandlingErrorsastheResultofaServiceCallout.36
8.21.TransportErrors.36
8.22.SOAPFaults.37
8.23.UnexpectedResponses.38
8.24.HandlingErrorsinMessageFlows.39
8.25.GeneratingtheErrorMessage,Reporting,andReplying.40
8.26.ExampleofActionCongurationinErrorHandlers.40
8.27.UsingDynamicRouting.42
8.28.SampleXMLFile.43
8.29.CreatinganXQueryResourceFromtheSampleXML..44
8.30.CreatingandConguringtheProxyServicetoImplementDynamicRouting.44
8.31.AccessingDatabasesUsingXQuery.46
8.32.UnderstandingMessageContext.47
8.33.MessageContextComponents.47
8.34.GuidelinesforViewingandAlteringMessageContext.49
8.35.UsingtheInlineXQueryExpressionEditor.50
8.36.InlineXQueries.51
8.37.UsesoftheInlineXQueryExpressionEditor.51
8.38.UsingVariableStructures.52
8.39.CreatingVariableStructureMappings.53
8.39.1.SampleWSDL..53
8.40.CreatingtheResourcesYouNeedfortheExamples.54
8.41.SavetheWSDLasaResource.55
8.42.CreateaProxyServiceThatUsestheSampleWSDL..55
8.43.BuildaMessageFlowfortheSampleProxyService.56
8.44.CreateaBusinessServiceThatUsestheSampleWSDL..56
8.45.Example1:SelectingaPredenedVariableStructure.57
8.46.Example2:CreatingaVariableStructureThatMapsaVariabletoaType.57
8.47.Example3:CreatingaVariableStructurethatMapsaVariabletoanElement.59
8.48.Example4:CreatingaVariableStructureThatMapsaVariabletoaChildElement.60
8.49.Example5:CreatingaVariableStructurethatMapsaVariabletoaBusinessService.61
8.50.Example6:CreatingaVariableStructureThatMapsaChildElementtoAnotherChildElement62
8.51.QualityofService.64
8.52.DeliveryGuarantees.64
8.53.OverridingtheDefaultElementA ribute.65
8.54.DeliveryGuaranteeRules.66
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 2/45
5/9/2017 3DaysTutorialinOSB|SOALair
8.54.DeliveryGuaranteeRules.66
8.55.ThreadingModel67
8.56.Spli ingProxyServices.68
8.57.OutboundMessageRetries.68
8.58.ContentTypes,JMSType,andEncoding.69
8.60.WSICompliance.69
8.61.WSIComplianceChecks.71
1.SERVICEORIENTEDARCHITECTURE
WhatisSOA?
ServiceOrientedArchitecture.ThiscouldbethebasicdenitionofSOA.
ButwhyisthenameSOA?
SOAisanarchitecturalapproachforbuildingbusinessprocesswithintegrationoflooselycoupledapplications/software(ServiceOrientation).
Mostofyoumightbethinkingwhatthehelldoesthatmean?
SOAoriginatedwiththeconceptofServiceorientation.Serviceorientationislisteningandunderstandingthecustomer(customercanbeworkingon
dierentplatformsbuttheywanttoaccessapplicationbuildonadierentenvironment).
ThatseemstobeeasywithwordsbutIstilldidnotgetwhatdoesSOAmeans.
LetusstartwithbasicunderstandingofevolutionofSOA.
Considerasocalledproblemdenitionwithwhichwewilltryto:
Analyzeandunderstandproblemsfacedwithorthodoximplementationofthesoftware.
HowdidevolutionofSOAhappened
HowwouldSOAimplementationhelpbusinessgainrevenue?
AssumethatyouareabusinessmanwhicheveryoneintheITindustrythinkstobeoneday,planning/dreamingeverydaytostartasidebusiness.Thisisone
typicalexamplewhichisusedeverywhere,aswecanndalotofhelpwiththistypicalexample.Wehavetriedtomakeitabitsimpleforbeginnersto
understandwithhelponline.
SoIbeingasmallmiddleclassITguyIhaveabrilliantideatostartasmallmortgagebusinesswhereIlendmoneyatlowrateofinterest.Istartwithan
onlineservicewhereusercanloginandapplyforaloan.Withanalysiswedenedaproblemdenitionfortheservice.
Problemdenition:
1)Iftherateofinterestfortheloanapplicationislessthan5%,thentheapplicationfortheloanhastogothroughaspecialapprovalfromthe
management.Wherethemanagementwouldanalyzetherequirementoftheapplicanthisneedsandapprove.
2)Allotherapplicationcanbedirectlysanctionedbytheservice,conditionedonhavingthedetailsoftheapplicant.
ThinkinglikeabusinessmanIstartwiththinkingonhowtosavemoney,sowhatIplantoimplementingthesoftwareallbyyourselfasIhavethe
backgroundofsoftwareafterallmyparentshavespendsomuchofmoneyitshouldbeusedsomewhere.
WithallmyknowledgeandITbackgroundIplantostartwiththeimplementation.
Basicandthemostimportthingforsoftwareisitsarchitecture.SobelowishowIplantoimplementmysoftware:
Firstpageofthescreen(assumingwillimplementloginlateron)whichacceptstheuserinformationanddetailsofloantobesanctioned.
Oncetheuserentersthedetails,savetheuserdetailsinauserdetailstableandroutetherequesttocallappropriatemethods,say
requestWithRateBelowFive()andrequestWithRateAboveFive().
Callthesemethodsbasedontherequesttypei.edetailsandbackgroundinformationandcapabilitytopaytheEMI.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 3/45
5/9/2017 3DaysTutorialinOSB|SOALair
Callthesemethodsbasedontherequesttypei.edetailsandbackgroundinformationandcapabilitytopaytheEMI.
After6longmonthsofworkandrigoroustestingofmysoftware,Iplantoputmysoftwarelive.
Withallthedomainregistrationdonemysoftwareislive.
Nowmyprojectisliveandisgivingmealotofprot.WiththeincreasedprotIwanttohavemorefunctionalitytobeaddedinmysoftware.
Extensiontoproblemdenition:
WhereIcanretrievethedetailsoftheuserwhoareconsistentwiththeirEMIsandareloyalcustomertothecompany.Atthesametimewithmillionsof
dollarsinasmyliquidcashIhaveacquiredacompanywhichgivesspecialoerstotheuserwithautoloanswithlowrateofinterest.
Problems:
WiththecurrentimplementationofmyprojectIwillhavetomodifytheentireimplementationtoincludethenewoerandmergethenewcompanies
softwareintomysoftware.
Thiswillresultindowntimefor2dayswhichisdirectlyproportionaltolossofsignicantamountofrevenueandcustomers.
Thisimplementation/architectureofprojectiscalledaspointtopointintegration.
Thisisoneoftheoldestandoriginalintegrationpa erns.
Itderivesitsnamefromthedirect,tightlyboundconnectionsthataremadebetweenapplicationsandisthesimplestoftheintegrationarchitectures.
Thereareadvantageswithpointtopointintegration:
PointtoPointsolutionsareoftenfastandecient.
TheeciencythatderivesfromapplicationsbeingtightlyboundisonereasonwhyatleastafewPointtoPointsolutionswillcontinuetobeutilizedfor
theforeseeablefuture.
Whatarethedrawbackswiththecurrentimplementation/architectureoftheproduct?
Asthenumberofapplicationsincreasessodoestheoverallcomplexityoftheenvironment.
Highmaintenancecostsandalackofexibility,whenitbecomesnecessarytomakechanges.
Conclusion:
ThebasicproblemistheArchitectureoftheproduct,tobespecicIntegrationarchitecture.
2.INTEGRATIONARCHITECTURE
SowhatisIntegrationarchitectureandhowisitsignicantforafastgrowingbusiness.
Consideranexampleofawelldeignedbuildingwhereallelectricsandplumbingkeepworkingnoma erhowmanyappliancesareswitchedonor
connected.
Thisbuildingiscapableenoughforextensionwithouttearinguptheblueprintandstartagainwithnewelectricalconnection.
Thisisanexampleofgoodarchitecture.
Thesameappliestosoftwaresystems.Softwarearchitectureisthebackboneofanycomplexcomputersystem.Thearchitectureencompassesallofthe
softwareelements,therelationshipsbetweentheelementsandtheuserinterfacestothoseelements.Theperformanceandreliabilityofasoftwaresystemare
highlydependentuponthesoftwarearchitecture.Welldesignedsoftwarearchitecturecanbeextendedwithrelativeeasetoaccommodatenewapplications
withoutrequiringextensiveinfrastructuredevelopment.
Nowquestioncomesdowntohowcanweeliminatethisdowntimeandinfuturewithnewacquisitionsintegration.
TherearemanyothertypesofINTEGRATIONARCHITECTURE:
3.HUBANDSPOKEINTEGRATIONARCHITECTURE
Theearliestformalintegrationtechnologiesworkedontheprinciplethatallinformationcomingfromtheapplicationshadtobeprocessedwithinasingle
machineorservercalledahub.Actingasacentralpointofcontrol,thehubdealtwithallmessageprocessingincludingrouting,spli ingandcombiningof
messages,mapping,andsoon.
HubandSpokeimplementationsdecouplethesendingandreceivingapplications.UnlikePointtoPoint,theapplicationsoneithersideofthehubcanbe 4/45
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/
5/9/2017 3DaysTutorialinOSB|SOALair
HubandSpokeimplementationsdecouplethesendingandreceivingapplications.UnlikePointtoPoint,theapplicationsoneithersideofthehubcanbe
modiedindependentlyofeachother.Sinceapplicationsnolongerneedtoperformdatamapping,centralizeddenitionandcontrolofbusinessprocesses
couldbeeasilyachievedforthersttime.
HubandSpokeArchitecture
CentralizedIntegrationProcessingHub
WhataretheadvantagesofHubandSpokearchitecture?
WithHubandSpoke,theintegrationenvironmentbecomeslesscomplex.WhereasPointtoPointbecomesimpossiblycomplicatedasthenumberof
connectionsincrease,HubandSpokeremains,inprinciple,simplesincealltheconnectionsaretoandfromthehub.HubandSpokeisthepreferred
architectureforachievinganeasilycontrolledandmanagedenvironmentinamediumsizedintegrationproject.
WhatarethedisadvantagesofHubandSpokearchitecture?
WithHubandSpoke,theinitialsetupoftwowaycommunicationscanbechallenging.Thehubhastocoordinatemessagesowingbetweenapplications,
andatthesametimeapplicationsonbothsidesofthehubneedtoworkwellinadecoupledfashion.Boththesourceandtargetapplicationsneedsome
knowledgeofeachotherinordertoprocessmessages.Thissometimesmakesitdiculttoaddorremovesendersandreceivers.
Sincethehubmustcontrolalloftheintegratedprocesses,itisaviableoptiononlywhenbothsenderandreceiveragreeonwhichhubtouse.Thiswillnotbe
aproblemforcompaniesthatareintegratinginternally,butmaybecomeaseriousissueforBusinesstoBusiness(B2B)andevencrossdepartmental
integrationprojects.
Unfortunately,withsomuchprocessingtakingplaceinthecentralhub,HubandSpokeexactshighoverheads.Processeswithinthehuboftenrequire
signicantprocessingpowerandlotsofdiskspace.Asthenumberandcomplexityofprocessesincrease,performancecansuerandhubsoftenbecome
diculttomanage,maintain,andextend.
PureHubandSpokeimplementationsdonotscalewell.OnesolutionistocreateaFederatedarchitecture,whichisanextensionofHubandSpokethat
allowsformultiplehubstoprovideloadsharingandbackupincaseoffailure.
4.DISTRIBUTEDINTEGRATIONARCHITECTURE
Indistributedarchitecture:
Messagetranslation,routing,spli ing,andcombiningareperformedclosertosourceandtargetsystembyusingsmallercomputerscalledagents.Agent
computersareconnectedtojustonesystemandreducetheprocessingloadonthatsystem.Agentstakeinformationfromtheapplicationtheyareconnected
to,processit,andsendittoanytargetapplication(s)interestedinreceivingthatinformation.
Thisisalsoknownaspeertopeerintegrationarchitecture.
WhataretheadvantagesofDistributedarchitecture?
Distributedarchitectureisgovernedbycentralizedrulesandtherequirementsofthebusinessow.Mostoftheprocessingisperformedinagentprocessors
locatednearthesourceandtargetapplications.Besidesgainsinprocessingeciencybydistributingtheworkloadamongdedicatedprocessors,a
DistributedArchitectureisabletogrowrelativelyeasily.
WhatarethedisadvantagesofDistributedarchitecture?
Manyorganizationshaveamixofplatformsandoperatingsystemsonwhichtheirbusinessapplicationsrun,asituationthatisoftentheresultofmergers
andacquisitions.Whenitbecomesnecessarytochangeorexpandthesystemarchitecture,itisunfortunatelynotsimplyama erofchoosingoneofthe
distributedtechnologiesandimplementingit.Optingforonetechnologymayonlyprovideadistributedsolutionforhalfofyourorganizationduetothe
mixofsystemsthatarebeingused.Beyondtheseinternalproblems,thereisalsotheissueofengaginginBusinesstoBusiness(B2B)exchangeswithother
companies.ThisisanothercasewhereaneclecticmixofsystemsandtechnologiesbetweenbusinessescanimpedetheuseofDistributedArchitecture.
5.SERVICEORIENTEDARCHITECTURE(SOA)
ServiceOrientedArchitecture(SOA)isthelatestarchitecturalapproach,althoughitsnotreallyverynew.
ServiceOrientedArchitectureisessentiallyanenhancedversionofDistributedArchitecturethatuseslooselycoupledsoftwareservicestosupportthe
requirementsofbusinessprocessesandsoftwareusers.
Itgoesastepfurtherthanthepreviousarchitecturesbyprovidinganintegratedenvironmentwhichspreadsouttheworkload,breakingdownthedierent
silosofbusinessfunctionalityandopeningtheirprocessestootherapplications.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 5/45
5/9/2017 3DaysTutorialinOSB|SOALair
silosofbusinessfunctionalityandopeningtheirprocessestootherapplications.
ApplicationscomprisedoflooselyboundWebServices.
OnewaytothinkofSOAislikeaLegoset.ALegosetismorethanjusttheindividualblocks;specializedbiggerpiecesforcomplexcreationsarealso
available.Similarly,withSOA,anapplicationcancustomizeand/orchangetheindividualpiecesorservicesthatituses.Usingtheseconcepts,vastand
complexcomponentbasedapplicationscanbedeveloped.
ThebreakthroughforSOAcamewiththeacceptanceofWebServices,wheredierentvendorsagreetoacommoncommunicationastandardwhichisXML.
AfterWebServicescameEnterpriseServiceBus(ESB)technology.BasedonWebServices,andexhibitingallofthecharacteristicsoftheMessagingsolutions
previouslysuppliedbytheintegrationvendors,ESBhasbecometheacceptedstandardforthecreationofanorganizationsServiceOrientedArchitecture.
WithoutexceptionalloftheintegrationvendorsnowprovideanSOAarchitecturebuiltontheconceptofanEnterpriseServiceBus(ESB).
Tosummarizethedenition,SOAisanarchitecturepa erntointegratelooselycoupledapplicationsintoonesystem.
ITcompanieshavestartedtorealizethattheultimateobjectivethesedaysforbuildingasystemwouldbetoautomatebusinessprocessesi.e.todevelop
applicationsthatwouldprovideacompleteowoftheprocessfromitsendtothebeginning.
TherearemanychallengesthatanITcompanybuildingtheapplicationwouldface.Twoofthebasicchallengeswhichlaythebasicfoundationofthe
developingbusinessprocessare:
1)Everycompanydoesnothavethesamerequirements.
2)Changesareconstantlyincorporatedinabusinessprocesstocompete;theenterpriseservicehastobeexibleenoughtoincorporatethechanges.
Ifyouarestillnotclearwiththedenitionyoumaysaythatthisstatementcontradictwiththebasicrequirementonwhichaserviceisbuildi.e.stabilityand
availabilitytoprocessasandwhenrequired.Hereitgoesagainwithverysimpleandclearwords.SOAisaggregationofsuchstableservices.Servicesare
constructedtobestableandecientwhileaggregationsaredesignedtobeagileorratheracceptthechanges.
Hencetheselooselycoupledservices(ServiceOriented)aggregationsaremuchmoreopentochangesratherthantheorthodoxmonolithicservicesthat
requireagestoincorporateevenasmallchangeintheservice.
Nowthequestionsariseshowaretheseindependentstableservicesaggregatedtodesignalooselycoupledsystem?Howdoweensurethatthestabilityof
theservicewillbemaintainedifitiscoupledwithanotherservicewhichisconstructedonadierentplatform?
Theanswertothequestionsisstandardizationoftheplatformonwhichtheservicesarecoupled.Theseservicesremainstablebyrelyingthemselveson
standardbasedinterfacesandstandard/denedmessages(SOAP/Schemas).
IhopethebasicquestionofwhySOAisintroducedinITindustryandhowwoulditlooklikeinatopviewofthesystemisclear.
Forabeginnertherearemillionsofquestionsthatneedstobeansweredwithrespecttotheingredientstocouplingofservices,howaretheseservices
deployedandonwhatplatformdowecoupleorratherhowdoweincorporatethestandardizationtointegratethissystem.Ihopethenextupcomingsection
ofSOAwouldanswertheirquestions.
6.EXTENSIBLEMARKUPLANGUAGE
WhatisXML?
FromdenitionsofW3C:
XMLstandsforEXtensibleMarkupLanguage.
XMLisamarkuplanguagemuchlikeHTML.
XMLwasdesignedtocarryandstoredata,nottodisplaydata.
XMLtagsarenotpredened.Youmustdeneyourowntags.
XMLisdesignedtobeselfdescriptive.
XMLisaW3CRecommendation.
Example:
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Dontforgetmethisweekend!</body>
</note>
Where:
Thetagsintheexampleabove(like<to>and<from>)arenotdenedinanyXMLstandard.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 6/45
5/9/2017
Where: 3DaysTutorialinOSB|SOALair
Thetagsintheexampleabove(like<to>and<from>)arenotdenedinanyXMLstandard.
ThesetagsareinventedbytheauthoroftheXMLdocument.
WhatisXMLnamespace?
XMLNamespacesprovideamethodtoavoidelementnameconicts.
TheXMLnamespaceisaspecialtypeofreservedXMLa ributethatyouplaceinanXMLtag.
Thisa ributeprexisxmlns:,whichstandsforXMLNameSpace.
Thecolonisusedtoseparatetheprexfromyournamespacethatyouarecreating.
WhatisXMLSchema?
AnXMLSchemadescribesthestructureofanXMLdocument.
TheXMLSchemalanguageisalsoreferredtoasXMLSchemaDenition(XSD).
AnXMLSchema:
deneselementsthatcanappearinadocument
denesa ributesthatcanappearinadocument
deneswhichelementsarechildelements
denestheorderofchildelements
denesthenumberofchildelements
deneswhetheranelementisemptyorcanincludetext
denesdatatypesforelementsanda ributes
Denesdefaultandxedvaluesforelementsanda ributes.
7.WEBSERVICEDESCRIPTIONLANGUAGE
WhatisWSDL?
WSDLstandsforWebServicesDescriptionLanguage
WSDLiswri eninXML
WSDLisanXMLdocument
WSDLisusedtodescribeWebservices
WSDLisalsousedtolocateWebservicesandtheoperations(ormethods)theserviceexposes.
WSDLisaW3Crecommendation.
Tostartwithanysoftwarewehaveclientrequirements.
Theserequirementsdenetheinputandtheoutputelementsoftheservice.
ThedatatypesoftheinputandoutputmessagesintermsifwhethertheinputmessagewillhaveaUserIDwithalengthdenedof8charactersanditshout
beofstringtype.
Theserequirementsarelikeacontractbetweentheprovideroftheserviceandtheuseroftheservice.Theusercannotaccesstheserviceifitprovidesthe
input(UserID)withmorethan8charactersandtheprovideroftheserviceneedstothrowafaultormaketheserviceunavailablefortheuserwithUserID
morethan8characters.
ThiscontactisdenedinadocumentcalledWSDLonwhichwebserviceisconstructed.
YoucansaythatWSDListhestiltofawebservice.
WSDLisdenitionofwebserviceinitslanguagei.e.XML.
Itisacontractbetweentheserviceproviderandtheuser.
Itisadescriptionofthewebservice.
WSDLcanbebrokendownto4criticalchunks.
1.Interfaceinformation/Operationinformation.
2.MessageInformation/Datatypeinformation.
3.BindingInformation/TransportInformation.
4.AddressInformation/LocationInformation.
WithrespecttoconstructingaWSDLitcanbedenedwith6majorelements:
1.denitions
2.types
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 7/45
5/9/2017 3DaysTutorialinOSB|SOALair
2.types
3.message
4.portType
5.binding
6.service
YoumightbethinkingwhyIhavewri entheelementsnameinlowercase.
Thiswouldsoundabitstupidbutthisishowtheelementsappearinthewsdldenition.
LetuslookatasampleWSDLnow.
<?xmlversion=1.0encoding=UTF8standalone=no?>
<wsdl:denitionsxmlns:soap=h p://schemas.xmlsoap.org/wsdl/soap/
xmlns:tns=h p://www.example.org/NewWSDLFile/xmlns:wsdl=h p://schemas.xmlsoap.org/wsdl/xmlns:xsd=h p://www.w3.org/2001/XMLSchema
name=NewWSDLFiletargetNamespace=h p://www.example.org/NewWSDLFile/>
<wsdl:types>
<xsd:schematargetNamespace=h p://www.example.org/NewWSDLFile/>
<xsd:elementname=NewOperation>
<xsd:complexType>
<xsd:sequence>
<xsd:elementname=intype=xsd:string/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:elementname=NewOperationResponse>
<xsd:complexType>
<xsd:sequence>
<xsd:elementname=outtype=xsd:string/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:messagename=NewOperationRequest>
<wsdl:partelement=tns:NewOperationname=parameters/>
</wsdl:message>
<wsdl:messagename=NewOperationResponse>
<wsdl:partelement=tns:NewOperationResponsename=parameters/>
</wsdl:message>
<wsdl:portTypename=NewWSDLFile>
<wsdl:operationname=NewOperation>
<wsdl:inputmessage=tns:NewOperationRequest/>
<wsdl:outputmessage=tns:NewOperationResponse/>
</wsdl:operation>
</wsdl:portType>
<wsdl:bindingname=NewWSDLFileSOAPtype=tns:NewWSDLFile>
<wsdl:operationname=NewOperation>
<soap:operationsoapAction=h p://www.example.org/NewWSDLFile/NewOperation/>
<wsdl:input>
<soap:bodyuse=literal/>
</wsdl:input>
<wsdl:output>
<soap:bodyuse=literal/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:servicename=NewWSDLFile>
<wsdl:portbinding=tns:NewWSDLFileSOAPname=NewWSDLFileSOAP>
<soap:addresslocation=h p://www.example.org//>
</wsdl:port>
</wsdl:service>
</wsdl:denitions>
IntheWSDLdescribedaboveallthe6elementsarehighlightedinblack.YouwouldbynowhaveconcludedthataWSDLisaggregationofthese6elements.
Letusnowseewhatexactlythese6elementsconsistsofandwhyaretheyincludedinaWSDLdenition.
1)denitions:ItistherootelementofalltheWSDLdocument.
Itdenesthenameofthewebservice.
</wsdl:denitions>
Itdenesvariousnamespacesthatisusedthroughoutthedocument.
2)types:Itdescribesthedatatypeofthemessagebeingexchanged.
Ifthemessageexchangeisonlyintermsofsimpledatatypesasstringandintegerthenthistypeselementwouldnotberequired.
OnemorethingtonoticeisWSDLdoesnotuseanyexclusivetypingsystem,butifnotdeclareditusesW3CXMLschemaspecicationsasthedefaultchoice.
<wsdl:types>
<xsd:schematargetNamespace=h p://www.example.org/NewWSDLFile/>
<xsd:elementname=NewOperation>
<xsd:complexType>
<xsd:sequence>
<xsd:elementname=intype=xsd:string/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:elementname=NewOperationResponse>
<xsd:complexType>
<xsd:sequence>
<xsd:elementname=outtype=xsd:string/>
</xsd:sequence>
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 9/45
5/9/2017 3DaysTutorialinOSB|SOALair
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
3)messages:Itprovidestheabstractofthemessagebeingtransferredinaonewaytransmission.Itcancontainoneormorepartelementswhichcanrefer
tomessageparametersorreturnvalues.
<wsdl:messagename=NewOperationRequest>
<wsdl:partelement=tns:NewOperationname=parameters/>
</wsdl:message>
<wsdl:messagename=NewOperationResponse>
<wsdl:partelement=tns:NewOperationResponsename=parameters/>
</wsdl:message>
4)portType:portTypecombinesmultiplemessageelementsdenedabovetocompletetheroundtripoftheoperation.Eachoperationtocompleteits
serviceneedstohaveasetofrequestandresponsemessagewhichisdescribedinthemessageelements.
EachportTypecanhavemultipleoperationselement.
<wsdl:portTypename=NewWSDLFile>
<wsdl:operationname=NewOperation>
<wsdl:inputmessage=tns:NewOperationRequest/>
<wsdl:outputmessage=tns:NewOperationResponse/>
</wsdl:operation>
</wsdl:portType>
Letuslinkupthe3elementsaboveandseewherewehavereachedintermsofWSDLdescription.
Startingfromthebo om,eachwebservicehasanoperationoritcanhavemanyoperationstoperform.Eachoperationduringitsservicetakesaninput
requestanddeliversanoutputresponse.ThisoperationisdenedinportTypeelementdescribedabove.Thisinputandoutputmessageshasmultiple
parametersordatatypesthatisdescribedintheelementmessage.Thedatatypecanbedenedseparatelyasacombinationofmanysubdatatypesor
elementswhichisdescribesundertypeselement.
5)binding:Thiselementdescribestheconcreteprotocol/standardonwhichtheservicewillbeimplemented.Itdescribesthedataformatspecicationon
whichthemessageandoperationsaredened.WSDLhasabuildinextensionfordeningSOAPbasedservices.HenceSOAPspecicinformationgoes
underthiselement.
<wsdl:bindingname=NewWSDLFileSOAPtype=tns:NewWSDLFile>
<wsdl:operationname=NewOperation>
<soap:operationsoapAction=h p://www.example.org/NewWSDLFile/NewOperation/>
<wsdl:input>
<soap:bodyuse=literal/>
</wsdl:input>
<wsdl:output>
<soap:bodyuse=literal/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
6)service:Thiselementdescribesthelocationortheaddressforinvokingtheservice.Itisusedtoaggregateasetofportstoretrievethelocationtoaccess
thespecicservice.
<wsdl:servicename=NewWSDLFile>
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 10/45
5/9/2017 3DaysTutorialinOSB|SOALair
<wsdl:servicename=NewWSDLFile>
<wsdl:portbinding=tns:NewWSDLFileSOAPname=NewWSDLFileSOAP>
<soap:addresslocation=h p://www.example.org//>
</wsdl:port>
</wsdl:service>
SothereitiswearedonewiththecreationofaWSDL.Alltheelementsdenedhereaggregatedwillletusdeneawebservicecontract.
ThisWSDLisaveryimportantaspectofawebservice.
Thiscontractdenesalltheelements/parametersneededintherequestandresponseoftheoperationandwhichisagreeduponbytheprovideranduserof
thewebservice.
Basedontherequirementsfromtheclienttheelementsaredescribedinthemessages.
TheinputthatisreceivedfromtheusertotheoperationisvalidatedagainsttheoperationelementsdescribedintheWSDL.Theirinputcannotviolatethe
descriptionoftheinputmessageintheWSDL,whichisanimportantaspectofwebservicessecurityoperations.
8.ORACLESERVICEBUS
Asexplainedearlierservicebusisasolutiontoproblemsfacedbypoorintegrationarchitecture.
1.8.
8.1.Bus,whatBus?
TheuseofaServiceBuspa ernhelpstodecouplethepiecesfromeachother,messagesarepassedbetweenthecomponentsintheformofasynchronous
eventtopicsinapublish/subscribepa ern,thatallowseveryparttobedecoupledfromtheotherpartandwedonotneedtospantransactionsorhold
connectionsbetweentheinternalcomponentsthatwouldultimatelycauseadegradationintheperformanceofthesystem.
TheServiceBusshouldalsoperformtheroutingofmessagesbetweenthecomponentssonocomponentswouldhavetobedependentontheknowledgeof
thelocationofanothercomponent.
Connectionsbetweentheuserinterfacewillandshouldbepointtopointasthisisrequiredforthecomponenttoperformitsdutywithintheconstraintsthat
areimposeduponit,thesameholdstrueforsoftwarearchitectures.
Thereductionofdependencyonotherpartsshouldbedrivenasfardownintothearchitectureasisreasonable,asthiswillleadonedownthepathof
exibilityandtestability.
Introduction:
Aproven,lightweight,congurationbased,policydrivenintegrationtechnologyspecicallydesignedforthetaskofintegrating,virtualizing,scalingservice
management,andtraditionalmessagebrokeringacrossheterogeneousITenvironmentsandmanagingservicesinaserviceorientedarchitecture(SOA),
OracleServiceBusenablesyoutoachievevaluemorequicklywithsimple,codefree,congurationbasedserviceintegration.Youwillbeabletomove
towardenterprisewideSOAdeploymentswithahighperformance,highlyscalableSOAintegrationbackbone.
TheOracleServiceBus(OSB)providesservicebuscapabilitiesfortheentirecompany,againincludingstandardfunctionalityastransformation,routing,
eventdeliveryandpayloadvalidation.Itsmainfunctionistodecoupleintraapplicationcommunicationfrominterapplication.Endpointchangeswillnot
aecttheinternalsofcompositeapplications.TheOSBisbasedontheAqualogicServiceBus,augmentedwithkeyfeaturesfromtheOracleESB,especially
JCAadapters,DVM,XrefandJDevbaseddesigntime.
Advantages:
Locationtransparency:Isolatefromchangestoservicelocation.
Backwardcompatibility:isolatefromchangestoservicecontactonthenewserviceadded.
Serviceenablement:allowmultipleprotocols/messagestoparticipateinSOA.
Dynamicrouting:Usebusinessrulestodeterminedestinationservice.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 11/45
5/9/2017 3DaysTutorialinOSB|SOALair
Dynamicrouting:Usebusinessrulestodeterminedestinationservice.
Messageenrichment:updatethemessageusingtheresponsefromanotherservice.
8.2.ResourcesinOracleServiceBus
InOracleServiceBusworld,alltheartifactsarecalledtheOSBresources.InatypicalSOAenvironment,therewillbeaneedtosharethedierentresources
acrosstheprojects.TheresourcescanbeanythinglikeWSDLs,XSDs,Proxy,Businessserviceetc..
WecannotcreateallkindsofresourcesintheOSBCongurationProject.ForexamplecreatingWSDLorXSDincongurationprojectwillgivetheerror.We
canonlycreatetheGlobalResourceslikeProxyServer,JNDIProviderandSMTPServer.AlltheseresourcesthatcanbecreatedintheOSBConguration
ProjectcanbeaccessedfromdierentOSBprojectspresentintheCongurationProject.
8.3.ProxyServicesandBusinessServices
OracleServiceBusprovidesintelligentmessagebrokeringbetweenbusinessservices(suchasenterpriseservicesanddatabases)andserviceclients(suchas
presentationapplicationsorotherbusinessservices)throughproxyservicesthatyoucancongureusingOracleServiceBusConsole.Proxyservicesare
OracleServiceBusdenitionsofintermediaryWebservicesthatOracleServiceBusimplementslocallyonWebLogicServer.WithOracleServiceBus
messagebrokering,serviceclientsexchangemessageswithanintermediaryproxyserviceratherthanworkingdirectlywithabusinessservice.
OracleServiceBusallowsyoutoimplementproxyservicesindependentlyandcongurethemdynamically,asdrivenbyyourbusinessneedswithout
requiringcostlyinfrastructuredevelopmenteorts.ThecongurationfunctionsareseparatedfromthemanagementfunctionsinOracleServiceBusConsole.
Aproxyservicecanroutemessagestomultiplebusinessservices;youcanchoosetocongureaproxyservicewithaninterfacethatisindependentofthe
businessserviceswithwhichtheproxyservicecommunicates.Insuchcases,youcancongureamessageowdenitiontorouteamessagetothe
appropriatebusinessserviceandmapthemessagedataintotheformatrequiredbythebusinessservicesinterface.
BusinessservicesareOracleServiceBusdenitionsoftheenterpriseservicesthatexchangemessagesduringbusinessprocesses.Abusinessserviceandits
interfacecanbedenedandconguredusingtheOracleServiceBusConsole.Tocongureabusinessserviceyoumustspecifyitsinterface,typeoftransport
ituses,itssecurityrequirements,andothercharacteristics.
Abusinessservicedenitionissimilartothatofaproxyservice,butitdoesnothaveapipeline.
8.4.MessageFlowsandPipelines
InOracleServiceBus,amessageowistheimplementationofaproxyservice.Youcongurethelogicforthemanipulationofmessagesusingproxyservice
messageowdenitions.Thislogicincludessuchactivitiesastransformation,publishing,andreporting,whichareimplementedasindividualactions
withinthestagesofapipeline.
Pipelinesareonewayprocessingpathsthatincludenobranching.Apipelineisanamedsequenceofstagescontainingactions,representinganonbranching
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 12/45
5/9/2017 3DaysTutorialinOSB|SOALair
Pipelinesareonewayprocessingpathsthatincludenobranching.Apipelineisanamedsequenceofstagescontainingactions,representinganonbranching
onewayprocessingpath.Itisusedtospecifythemessageowforservicerequestsandresponses.Astageisauserconguredprocessingstep.Messagesfed
intothepipelinesareaccompaniedbyasetofmessagecontextvariablesthatcontainthemessagecontents.Theycanbeaccessedormodiedbyactionsin
thepipelinestages.
8.5.PipelinePairs
Pipelinepairsarerequestandresponsepipelines.TherequestpipelinedenitionspeciestheactionsthatOracleServiceBusperformsonrequestmessages
totheproxyservicebeforeinvokingabusinessserviceoranotherproxyservice.TheresponsepipelinedenitionspeciestheprocessingthatOracleService
Busperformsonresponsesfromthebusinessorproxyservicethattheproxyserviceinvokesbeforereturningaresponsetoaclient.
Eachpipelineconsistsofasequenceofstages,eachstagecontainingactions.However,asingleservicelevelrequestpipelinemightoptionallybranchout
intooperationalpipelines(youcancongureonedefaultoperationalpipelineatmostoneperoperation).Thedeterminationoftheoperationisdonethrough
userselectedcriteria.Theresponseprocessingstartswiththerelevantoperationpipelinewhichthenjoinsintoasingleservicelevelresponsepipeline.
Figure13(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/tutorial/tutIntro.html#wp1045160)illustratessampleoperationpipelinesina
proxyservice.
Figure13ExampleofOperationPipelinesinaProxyService
8.6.MessageFlowComponents
Amessageowiscomposedofcomponentsthatdenethelogicforroutingandmanipulatingmessagesastheyowthroughaproxyservice.Nodesare
conguredtoroutemessagesthroughthemessageow,andstagesandactionscontainrulesforprocessingandtransformingmessages.
Mostoftheprocessinglogicinamessageowishandledinpipelines.Apipelineisanamedsequenceofstagesrepresentinganonbranchingoneway
processingpath.Pipelinesbelongtooneofthefollowingcategories:
Requestpipelinesprocesstherequestpathofthemessageow.
Responsepipelinesprocesstheresponsepathofthemessageow.
Errorpipelineshandleerrorsforstagesandnodesinamessageowaswellaserrorsatthelevelofthemessageow(service).
Toimplementtheprocessinglogicofaproxyservice,requestandresponsepipelinesarepairedtogetherinpipelinepairnodes.Thesepipelinepairnodes
canbecombinedwithothernodesintoasinglerootedtreestructuretocontroloverallow.
Table31(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1118731)describesthecomponents
availablefordeningmessageows.
Component Summary
Type
Startnode Everymessageowbeginswithastartnode.Allmessagesenterthemessageowthroughthestartnode,andallresponsemessagesare
returnedtotheclientthroughthestartnode.Thereisnothingtocongureinastartnode.
Pipeline Apipelinepairnodecombinesasinglerequestpipelineandasingleresponsepipelineinonetoplevelelement.Apipelinepairnodecan
pairnode haveonlyonedirectdescendantinthemessageow.Duringrequestprocessing,onlytherequestpipelineisexecutedwhenOracleService
Busprocessesapipelinepairnode.TheexecutionpathisreversedwhenOracleServiceBusprocessestheresponsepipeline.
Stage Requestpipelines,responsepipelines,anderrorhandlerscancontainstages,whereyoucongureactionstomanipulatemessagespassing
throughthepipeline.
Error Anerrorhandlercanbea achedtoanynodeorstage,tohandlepotentialerrorsatthatlocation.
handler
Branch Abranchnodeallowsprocessingtoproceedalongexactlyoneofseveralpossiblepaths.OperationalbranchingissupportedforWSDL
node basedservices,wherethebranchingisbasedonoperationsdenedintheWSDL.Conditionalbranchingissupportedforconditions
denedinanXPathbasedswitchtable.
Routenode Aroutenodeperformsrequest/responsecommunicationwithanotherservice.Itrepresentstheboundarybetweenrequestandresponse
processingfortheproxyservice.Whentheroutenodedispatchesarequestmessage,therequestprocessingisconsideredcomplete.When
theroutenodereceivesaresponsemessage,theresponseprocessingbegins.Theroutenodesupportsconditionalroutingaswellasrequest
andresponsetransformations.
Becausearoutenoderepresentstheboundarybetweenrequestandresponseprocessing,itcannothaveanydescendantsinthemessage
ow.
Figure31(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1060397)showsahighlevelviewof13/45
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/
5/9/2017 3DaysTutorialinOSB|SOALair
Figure31(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1060397)showsahighlevelviewof
componentsinamessageowdenition.
Figure31ComponentsofMessageFlow
8.7.BuildingaMessageFlow
Theonlycomponentsrequiredinamessageowareastartnodeandaroutenode.Norestrictionsexistonwhatothercomponentscanbechainedtogether
inthemessageow.Youcouldcreateasingleroutenodethatcontainedallthelogicfortheow.Or,youcouldlinktwopipelinepairnodeswithouta
branchnodeinbetween.Ifyouusebranchnodes,eachbranchnodecouldstartwithadierentelement.Onebranchcouldterminatewitharoutenode,
anothercouldbefollowedbyapipelinepair,andyetanothercouldhavenodescendant.(Whenabranchwithnodescendantsisexecutedatruntime,
responseprocessingbeginsimmediately.)
However,ingeneral,amessageowislikelytobedesignedinoneofthefollowingways:
Fornonoperationalservices(servicesthatarenotbasedonWSDLswithoperations),theowconsistsofasinglepipelinepairattherootfollowedbya
routenode.
Foroperationalservices,theowconsistsofasinglepipelinepairattheroot,followedbyabranchnodebasedonanoperation,witheachbranch
consistingofapipelinepairfollowedbyaroutenode.
8.8.MessageExecution
Tablebelowdescribeshowmessageareprocessesinatypicalmessageow:
MessageFlowNode Whathappensduringmessageprocessing?
RequestProcessing
Startnode Requestprocessingbeginsatthestartnode.
Pipelinepairnode Executestherequestpipelineonly.
Branchnode Evaluatesthebranchtableandproceedsdowntherelevant
branch.
Routenode Performstheroutealongwithanyrequesttransformations.
Inthemessageow,regardlessofwhetherroutingtakesplace
ornot,theroutenoderepresentsthetransitionfromprocessing
arequesttoprocessingaresponse.Attheroutenode,the
directionofthemessageowisreversed.Ifarequestpathdoes
nothavearoutenode,theresponseprocessingisinitiatedin
thereversedirectionwithoutwaitingforanyresponse.
ResponseProcessing Skipsanybranchnodesandcontinueswiththenodethat
precededthebranch
Routenode Executesanyresponsetransformations.
Branchnode Skipsanybranchnodesandcontinueswiththenodethat
precededthebranch
Pipelinepairnode Executestheresponsepipeline
Startnode Sendstheresponsebacktotheclient
8.9.BranchinginMessageFlows
Twokindsofbranchingaresupportedinmessageows:operationalbranching,conguredinanoperationalbranchnode,andconditionalbranching,
conguredinaconditionalbranchnode.
8.9.1.OperationalBranching
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 14/45
5/9/2017 3DaysTutorialinOSB|SOALair
WhenmessageowsdeneWSDLbasedproxyservices,operationspecicprocessingisrequired.Whenyoucreateanoperationalbranchnodeina
messageow,youcanbuildbranchinglogicbasedontheoperationsdenedintheWSDL.
YoumustuseoperationalbranchingwhenaproxyserviceisbasedonaWSDLwithmultipleoperations.Youcanconsiderusinganoperationalbranchnode
tohandlemessagesseparatelyforeachoperation.
8.9.2.ConditionalBranching
Useconditionalbranchingtobranchbasedonaspeciedcondition,forexamplethedocumenttypeofamessage.
Conditionalbranchingisdrivenbyalookuptablewitheachbranchtaggedwithsimple,uniquestringvalues,forexample,QuantityEqualToOrLessThan150
andQuantityMoreThan150.
Youcancongureaconditionalbranchtobranchbasedonthevalueofavariableinthemessagecontext(declared,forexample,inastageearlierinthe
messageow),oryoucanconguretheconditiontobranchbasedontheresultsofanXPathexpressiondenedinthebranchitself.
Atruntime,thevariableortheexpressionisevaluated,andtheresultingvalueisusedtodeterminewhichbranchtofollow.Ifnobranchmatchesthevalue,
thedefaultbranchisfollowed.Abranchnodemayhaveseveraldescendantsinthemessageow:oneforeachbranch,includingthedefaultbranch.You
shouldalwaysdeneadefaultbranch.Youshoulddesigntheproxyserviceinsuchawaythatthevalueofalookupvariableissetbeforereachingthebranch
node.
Forexample,considerthefollowingcaseusingalookupvariable.AproxyserviceisoftypeanySOAPoranyXML,andyouneedtodeterminethetypeof
themessagesoyoucanperformconditionalbranching.Youcandesignastageactiontoidentifythemessagetypeandthendesignaconditionalbranching
nodelaterintheowtoseparateprocessingbasedonthemessagetype.
NowconsiderthefollowingcaseusinganXPathexpressionintheconditionalbranchnode.Youwanttobranchbasedonthequantityinanorder.That
quantityispassedviaavariablethatcanberetrievedfromaknownlocationin$body.
YoucoulddenethefollowingXPathexpressiontoretrievethequantity:
declarenamespacecom=oracle.com/demo/orders/cmnCust;
./openuri:processCust/com:cmnCust/com:Order_Items/com:Item/com:Quantity
Thecondition(forexample,<500)isthenevaluatedinorderdownthemessageowagainsttheexpression.Whicheverconditionissatisedrstdetermines
whichbranchisfollowed.Ifnobranchconditionissatised,thenthedefaultbranchisfollowed.
Youcanuseconditionalbranchingtoexposetheroutingalternativesforthemessageowatthetoplevelowview.Forexample,considerasituationwhere
youwanttoinvokeserviceAorserviceBbasedonaconditionknownearlyinthemessageow(forexample,themessagetype).Youcouldcongurethe
conditionalbranchinginaroutingtableintheroutenode.However,thatmakesthebranchingsomewhatmorediculttofollowifyouarejustlookingat
thetopleveloftheow.Instead,youcoulduseaconditionalbranchnodetoexposethisbranchinginthemessageowitselfandusesimpleroutenodesas
thesubowsforeachofthebranches.
Consideryourbusinessscenariobeforedecidingwhetheryoucongurebranchinginthemessageoworinastageorroutenode.Whenmakingyour
decision,rememberthatconguringbranchesinthemessageowcanbeawkwardinthedesigninterfaceifalargenumberofbranchesextendfromthe
branchnode.
8.10.ConfiguringActionsinStagesandRouteNodes
Actionsprovideinstructionsforhandlingmessagesinpipelinestages,errorhandlerstages,androutenodes.Thecontextdetermineswhichactionsare
availableintheOracleServiceBusConsoleorintheOracleServiceBusPluginsforWorkshopforWebLogic,asdescribedinthefollowingsections:
CommunicationActions(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1126011)
FlowControlActions(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1125471)
MessageProcessingActions(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1070403)
ReportingActions(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1080496)
8.10.1.CommunicationActions
Communicationactionscontrolmessageow:
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 15/45
5/9/2017 3DaysTutorialinOSB|SOALair
8.10.2.FlowControlActions
Flowcontrolsactionsimplementconditionalrouting,conditionallooping,anderrorhandling.Youcanalsousethemtonotifytheinvokerofsuccessorto
skiptherestoftheactionsinthestage:
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 16/45
5/9/2017 3DaysTutorialinOSB|SOALair
Thereplyactioncanbe
usedintherequest,
responseorerrorpipeline.
Youcancongureitto
resultinareplywith
successorfailure.Inthe
caseofreplywithfailure
wheretheinbound
transportisHTTP,the
replyactionspeciesthat
animmediatereplyissent
totheinvoker
8.10.3.MessageProcessingActions
Theactionsinthiscategoryprocessthemessageow.Table35
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1123526)describesthemessageprocessing
actions.
Error
handler
stage
Error
handler
stage
Error
handler
stage
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 17/45
5/9/2017 3DaysTutorialinOSB|SOALair
Error
handler
stage
Error
handler
stage
ThereplaceactionisoneofasetofUpdateactions.
Error
handler
stage
8.10.4.ReportingActions
Youusetheactionsinthiscategorytologorreporterrorsandgeneratealertsifrequiredinamessageowwithinastage.Table34
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1123189)describesthereportingactions.
Error
handler
stage
Error
handler
stage
8.11.ConfiguringTransportHeadersinMessageFlows
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 18/45
5/9/2017 3DaysTutorialinOSB|SOALair
Thetransportheaderactionisacommunicationtypeaction,anditisavailableinpipelinestagesanderrorhandlerstages.
8.11.1.ConfiguringGlobalPassThroughandHeaderSpecificCopyOptionsfor
TransportHeaders
Thefollowingoptionsareavailablewhenyoucongureatransportheadersaction:
ThePassallHeadersthroughPipelineoptionspeciesthatatruntime,thetransportheadersactionpassesallheadersthroughfromtheinbound
messagetotheoutboundmessageorviceversa.Everyheaderinthesourcesetofheadersiscopiedtothetargetheaderset,overwritinganyexisting
valuesinthetargetheaderset.
TheCopyHeaderfromInboundRequestoptionandtheCopyHeaderfromOutboundResponseoptionsspeciesthatatruntime,thetransport
headersactioncopiesthespecicheaderwithwhichthisoptionisassociatedfromtheinboundmessagetotheoutboundmessageorviceversa.
Usetheoptionsinawaythatbestsuitsyourscenario.Bothoptionsresultintheheadersinthesourceheadersetbeingcopiedtothetargetheaderset,
overwritinganyexistingvalueinthetargetset.NotethatthePassallHeadersthroughPipelineoptionisexecutedbeforetheheaderspecicCopyHeader
options.Inotherwords,foragiventransportheadersactionconguration,ifyouselectPassallHeadersthroughPipeline,thereisnoneedtoselectthe
CopyHeaderoptionforgivenheaders.
However,youcanselectPassallHeadersthroughPipelinetocopyallheaders,andsubsequentlyconguretheactionsuchthatindividualheadersare
deletedbyselectingDeleteHeaderforspecicheaders.
WARNING: Becausetransportheadersarespecictothetransporttypes,itisrecommendedthatthepassthrough(orcopy)optionsonlybeusedto
copyheadersbetweenservicesofthesametransporttype.Passing(orcopying)headersbetweenservicesofdierenttransporttypescan
resultinanerroriftheheaderbeingpassedisnotacceptedbythetargettransport.Forthesamereasons,becarefulwhenyouspecifya
headernameusingtheSetHeaderoption.
8.11.1.1.UnderstandingHowtheRunTimeUsestheTransportHeadersSettings
Asdescribedabove,youcanusetransportheaderactionstocongurethevaluesofthetransportheadersforoutboundrequests(themessagessentoutbya
proxyserviceinroute,publish,orservicecalloutactions)andinboundresponses(theresponsemessagesaproxyservicesendsbacktoclients).Ingeneral,
theheadervaluescanbe:
SpeciedusinganXQueryexpression
Passedthroughfromthesourcetothetargetservice
Deletedwhilegoingfromthesourcetothetargetservice
Thetransportheadersactionallowsyoutoset,delete,orpassthroughtheheadersin$inboundor$outbound.Ifyousetordeletetheseheadersandthenlog
$inboundor$outbound,youcanseetheeectsofyourchanges.However,whenthemessageissentout,theOracleServiceBusbindinglayermaymodifyor
removesomeheadersin$inboundor$outboundandtheunderlyingtransportmayinturn,ignoresomeoftheseheadersanduseitsownvalues.An
importantdistinctionisthatanymodicationsdonebythebindinglayeronaheaderaredonedirectlyto$inboundand$outbound,whereasmodications
donebythetransportaectsonlythemessageswireformat.Forexample,althoughyoucanspecifyavaluefortheoutboundContentLengthheader,the
bindinglayerdeletesitfrom$outboundwhensendingthemessage.Consequently,themodicationisvisibleintheresponsepath(forexample,youcansee
themodiedvalueifyoulog$outbound).IfyousettheUserAgentheaderin$outbound,theHTTPtransportignoresitanduseitsownvaluehowever,the
valuein$outboundisnotchanged.
Table37(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1120452)describesthetransportheaders
thatareignoredoroverwri enatruntimeandotherlimitationsthatexistforspecictransportheaders.
Connection
Host
UserAgent
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 19/45
5/9/2017 3DaysTutorialinOSB|SOALair
Ifsendingtoarequest/responseservicebasedonJMSCorrelationIDcorrelation,theseheadersareoverwri enat
runtime.
Shouldbesettothemessagetimetoliveinmilliseconds.Theresultingvalueinthemessagereceivedisthesumof JMSExpiration
thetimetolivevaluespeciedbytheclientandtheGMTatthetimeofthesendorpublish1
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1120514).
TheOracleServiceBusruntimesetstheseheaders.Inotherwords,anyspecicationsyoumakefortheseheadersat JMSMessageID
designtimeareoverwri enatruntime.
JMSRedelivered
JMSTimestamp
JMSXDeliveryCount
JMSXUserID
JMS_IBM_PutDate2
(h p://download.oracle.com/docs
JMS_IBM_PutTime2
(h p://download.oracle.com/docs
JMS_IBM_PutApplType2
(h p://download.oracle.com/docs
JMS_IBM_Encoding2
(h p://download.oracle.com/docs
JMS_IBM_Character_Set2
(h p://download.oracle.com/docs
BecauseIBMMQdoesnotallowcertainpropertiestobesetbyaclientapplication,ifyousettheseheaderswith JMSXDeliveryCount
respecttoanIBMMQdestination,aruntimeexceptionisraised.
JMSXUserID
JMSXAppID
TheseheaderscannotbedeletedwhenthePassallHeadersthroughPipelineoptionisalsospecied. JMSDeliveryMode
JMSExpiration
JMSMessageID
JMSRedelivered
JMSTimestamp
JMSXDeliveryCount
FTP Nolimitations.Inotherwordsyoucansetordeletetheheader(s)3
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1120617)
File forFileandFTPtransportsandyourspecicationsarehonoredbytheOracleServiceBusruntime.
Forexample,ifyousettheJMSExpirationheaderto1000,andatthetimeofthesend,GMTis1,000,000(asaresultofSystem.currentTimeMillis()),ther
HeadernameswiththeJMS_IBMprexaretobeusedwithrespecttodestinationshostedbyanIBMMQserver
ForFTPandleproxies,thereisantransportrequestheaderleName.Thevalueofthisrequestheaderisthenameofthelebeingpolled.
8.12.PerformingTransformationsinMessageFlows
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 20/45
5/9/2017 3DaysTutorialinOSB|SOALair
Transformationmapsdescribethemappingbetweentwodatatypes.OracleServiceBussupportsdatamappingthatusestheXQueryandtheeXtensible
StylesheetLanguageTransformation(XSLT)standards.XSLTmapsdescribeXMLtoXMLmappings.XQuerymapscandescribeXMLtoXML,XMLtonon
XML,andnonXMLtoXMLmappings.
Thepointinamessageowatwhichyouspecifyatransformationdependsonwhether:
Themessageformatreliesontargetservicesthatis,themessageformatmustbeinaformatacceptablebytheroutedestination.Thisapplieswhenthe
transformationisperformedinaroutenodeorinoneofthepublishactions.
Publishactionsidentifyatargetserviceforamessageandcongurehowthemessageispackagedandsenttothatservice.OracleServiceBusalsoprovides
publishtableactions.Apublishtableactionconsistsofasetofrouteswrappedinaswitchstyleconditiontable.Itisashorthandconstructthatallows
dierentroutestobeselected,basedupontheresultsofasingleXQueryexpression.
Youperformthetransformationontheresponseorrequestmessageregardlessoftheroutedestination.Inthiscase,youcancongurethe
transformationsintherequestorresponsepipelinestages.
8.13.TransformationsandPublishActions
Whentransformationsaredesignedinpublishactions,thetransformationshavealocalcopyofthe$outboundvariableandmessagerelatedvariables
($header,$body,and$a achments).Anychangesyoumaketoanoutboundmessageinapublishactionaectonlythepublishedmessage.Inotherwords,
thechangesyoumakeinthepublishactionarerolledbackbeforethemessageowproceedstoanyactionsthatfollowthepublishactioninyourmessage
ow.
Forexample,consideramessageowthatdealswithalargepurchaseorder,andyouhavetosendthesummaryofthepurchaseorder,throughemail,to
themanager.ThesummaryoftheofthepurchaseorderiscreatedintheSOAPbodyoftheincomingmessagewhenyouincludeapublishactioninthe
requestpipeline.Inthepublishaction,thepurchaseorderdataistransformedintoasummaryofthepurchaseorderforexample,allthea achmentsin
$a achmentscanbedeletedbecausetheyarenotrequiredinthesummaryofthepurchaseorder.
8.14.TransformationsandRouteNodes
Youmayneedtoroutemessagestooneoftwodestinations,basedonaWSaddressingheader.Inthatcase,contentbasedroutingandthesecond
destinationrequirethenewerversionofthedocumentintheSOAPbody.Inthissituation,youcanconguretheroutenodetoconditionallyroutetooneof
thetwodestinations.Youcancongureatransformationintheroutenodetotransformthedocumentfortheseconddestination.
Youcanalsosetthecontrolelementsintheoutboundcontextvariable($outbound)toinuencethebehaviorofthesystemfortheoutboundmessage(for
example,youcansettheQualityofService).
SeeInboundandOutboundVariables(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1107145)andConstructing
MessagestoDispatch(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1057143)forinformationaboutthesub
elementsoftheinboundandoutboundvariablesandhowthecontentofmessagesisconstructedusingthevaluesofthevariablesinthemessagecontext.
8.15.ConstructingServiceCalloutMessages
WhenOracleServiceBusmakesacalltoaserviceviaaservicecalloutaction,thecontentofthemessageisconstructedusingthevaluesofvariablesinthe
messagecontext.Themessagecontentforoutboundmessagesishandleddierentlydependinguponthetypeofthetargetservice.
HowthemessagecontentiscreateddependsonthetypeofthetargetserviceandwhetheryouchoosetoconguretheSOAPbodyorthepayload
(parametersordocument),asdescribedinthefollowingtopics:
SOAPDocumentStyleServices(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1134675)
SOAPRPCStyleServices(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103510)
XMLServices(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103547)
MessagingServices(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103564)
8.16.SOAPDocumentStyleServices
MessagesforSOAPDocumentStyleservices(includingEJBdocumentanddocumentwrappedservices),canbeconstructedasfollows:
ThevariableassignedfortherequestdocumentcontainstheSOAPbody.
ThevariableassignedfortheSOAPrequestheadercontainstheSOAPheader.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 21/45
5/9/2017 3DaysTutorialinOSB|SOALair
ThevariableassignedfortheSOAPrequestheadercontainstheSOAPheader.
TheresponsemustbeasingleXMLdocumentitisthecontentoftheSOAPbodyplustheSOAPheader(ifspecied)
ToillustratehowmessagesareconstructedduringcalloutstoSOAPDocumentStyleservices,consideraservicecalloutactionconguredasfollows:
RequestDocumentVariable:myreq
ResponseDocumentVariable:myresp
SOAPRequestHeader:reqheader
SOAPResponseHeader:respheader
Assumealsothatatruntime,therequestdocumentvariable,myreq,isboundtothefollowingXML.
Listing31ContentofRequestVariable(myreq)
Atruntime,theSOAPrequestheadervariable,reqheader,isboundtothefollowingSOAPheader.
Listing32ContentofSOAPRequestHeaderVariable(reqheader)
<soap:Headerxmlns:soap=h p://schemas.xmlsoap.org/soap/envelope/
xmlns:wsa=h p://schemas.xmlsoap.org/ws/2003/03/addressing>(h p://schemas.xmlsoap.org/ws/2003/03/addressing>);
<wsa:Action></wsa:Action>
<wsa:To></wsa:To>
<wsa:From></wsa:From>
<wsa:ReplyTo></wsa:ReplyTo>
<wsa:FaultTo></wsa:FaultTo>
</soap:Header>
Inthisexamplescenario,thefullbodyofthemessagesenttotheexternalserviceisshowninListing33
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103498)(thecontentsofthemyreqand
reqheadervariablesareshowninbold).
Listing33MessageSenttotheServiceasaResultofServiceCalloutAction
<?xmlversion=1.0encoding=UTF8?>
<soapenv:Envelopexmlns:soapenv=h p://schemas.xmlsoap.org/soap/envelope/>(h p://schemas.xmlsoap.org/soap/envelope/>);
<soap:Headerxmlns:soap=hp://schemas.xmlsoap.org/soap/envelope/
xmlns:wsa=hp://schemas.xmlsoap.org/ws/2003/03/addressing>(hp://schemas.xmlsoap.org/ws/2003/03/addressing>);
<wsa:Action></wsa:Action>
<wsa:To></wsa:To>
<wsa:From></wsa:From>
<wsa:ReplyTo></wsa:ReplyTo>
<wsa:FaultTo></wsa:FaultTo>
</soap:Header>
<soapenv:Body>
<sayHelloxmlns=hp://www.openuri.org/>(hp://www.openuri.org/>);
<intVal>100</intVal>
<string>Hello</string>
</sayHello>
</soapenv:Body>
</soapenv:Envelope>
Basedonthecongurationoftheservicecalloutactiondescribedabove,theresponsefromtheserviceisassignedtothemyrespvariable.Thefullresponse
fromtheexternalserviceisshowninListing34
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103502).
Listing34ResponseMessageFromtheServiceasaResultofServiceCalloutAction
<?xmlversion=1.0encoding=UTF8?>
<env:Envelopexmlns:env=h p://schemas.xmlsoap.org/soap/envelope/”(h p://schemas.xmlsoap.org/soap/envelope/”);
xmlns:xsi=h p://www.w3.org/2001/XMLSchemainstance”(h p://www.w3.org/2001/XMLSchemainstance”);
xmlns:soapenc=h p://schemas.xmlsoap(h p://schemas.xmlsoap).
org/soap/encoding/xmlns:xsd=h p://www.w3.org/2001/XMLSchema>(h p://www.w3.org/2001/XMLSchema>);
<env:Header/>
<env:Bodyenv:encodingStyle=h p://schemas.xmlsoap.org/soap/encoding/>(h p://schemas.xmlsoap.org/soap/encoding/>);
<m:sayHelloResponsexmlns:m=h p://www.openuri.org/>(h p://www.openuri.org/>);
<resultxsi:type=xsd:string>ThismessagebroughttoyoubyHelloandthenumber100
</result>
</m:sayHelloResponse>
</env:Body>
</env:Envelope>
Inthisscenario,themyrespvariableisassignedthevalueshowninListing35
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 22/45
5/9/2017 3DaysTutorialinOSB|SOALair
Inthisscenario,themyrespvariableisassignedthevalueshowninListing35
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103506).
Listing35ContentofResponseVariable(myresp)asaResultofServiceCalloutAction
8.17.SOAPRPCStyleServices
MessagesforSOAPRPCStyleservices(includingEJBRPCservices)canbeconstructedasfollows:
Requestmessagesareassembledfrommessagecontextvariables.
TheSOAPbodyisbuiltbasedontheSOAPRPCformat(operationwrapper,parameterwrappers,andsoon).
TheSOAPheaderisthecontentofthevariablespeciedfortheSOAPrequestheader,ifoneisspecied.
Partaselementtheparametervalueisthevariablecontent.
Partassimpletypetheparametervalueisthestringrepresentationofthevariablecontent.
Partascomplextypetheparametercorrespondstorenamingtherootofthevariablecontentaftertheparametername.
Responsemessagesareassembledasfollows:
TheoutputcontentisthecontentofSOAPheader,ifaSOAPheaderisspecied.
Partaselementtheoutputcontentisthechildelementoftheparameter;thereisatmostonechildelement.
Partassimple/complextypetheoutputcontentistheparameteritself.
ToillustratehowmessagesareconstructedduringcalloutstoSOAPRPCStyleservices,lookatthisexamplewiththefollowingconguration:
Amessagecontextvariableinput1isboundtoavalue100.
Amessagecontextvariableinput2isboundtoastringvalue:Hello.
Aservicecalloutactionconguredasfollows:
RequestParameterintval:input1
RequestParameterstring:input2
ResponseParameterresult:output1
Inthisscenario,thebodyoftheoutboundmessagetotheserviceisshowninListing36
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103534).
Listing36ContentofOutboundMessage
<?xmlversion=1.0encoding=UTF8?>
<soapenv:Envelopexmlns:soapenv=h p://schemas.xmlsoap.org/soap/envelope/>(h p://schemas.xmlsoap.org/soap/envelope/>);
<soapenv:Body>
<sayHello2xmlns=h p://www.openuri.org/>(h p://www.openuri.org/>);
<intVal>100</intVal>
<string>Hello</string>
</sayHello2>
</soapenv:Body>
</soapenv:Envelope>
TheresponsereturnedbytheservicetowhichthecallwasmadeisshowninListing37
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103538).
Listing37ContentofResponseMessageFromthehelloWorldService
<?xmlversion=1.0encoding=UTF8?>
<env:Envelopexmlns:env=h p://schemas.xmlsoap.org/soap/envelope/”(h p://schemas.xmlsoap.org/soap/envelope/”);
xmlns:xsi=h p://www.w3.org/2001/XMLSchemainstance”(h p://www.w3.org/2001/XMLSchemainstance”);
xmlns:soapenc=h p://schemas.xmlsoap.org/soap/encoding/”(h p://schemas.xmlsoap.org/soap/encoding/”);
xmlns:xsd=h p://www.w3.org/2001/XMLSchema>(h p://www.w3.org/2001/XMLSchema>);
<env:Header/>
<env:Bodyenv:encodingStyle=h p://schemas.xmlsoap.org/soap/encoding/>(h p://schemas.xmlsoap.org/soap/encoding/>);
<m:sayHello2Responsexmlns:m=h p://www.openuri.org/>(h p://www.openuri.org/>);
<resultxsi:type=n1:HelloWorldResultxmlns:n1=java:>
<messagexsi:type=xsd:string>
ThismessagebroughttoyoubyHelloandthenumber100
</message>
</result>
</m:sayHello2Response>
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 23/45
5/9/2017 3DaysTutorialinOSB|SOALair
</m:sayHello2Response>
</env:Body>
</env:Envelope>
Themessagecontextvariableoutput1isassignedthevalueshowninListing38
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103542).
Listing38ContentofOutputVariable(output1)
8.18.XMLServices
MessagesforXMLservicescanbeconstructedasfollows:
Therequestmessageisthecontentofthevariableassignedfortherequestdocument.
ThecontentoftherequestvariablemustbeasingleXMLdocument.
Theoutputdocumentistheresponsemessage.
ToillustratehowmessagesareconstructedduringcalloutstoXMLservices,takeforexampleaservicecalloutactionconguredasfollows:
RequestDocumentVariable:myreq
ResponseDocumentVariable:myresp
Assumealsothatatruntime,therequestdocumentvariable,myreq,isboundtothefollowingXML.
Listing39ContentofmyreqVariable
Inthisscenario:
Theoutboundmessagepayloadisthevalueofthemyreqvariable,asshowninTable39
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103556).
Theresponseandthevalueassignedtothemessagecontextvariable,myresp,isshowninListing310
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103562).
Listing310ContentofmyrespVariable
8.19.MessagingServices
InthecaseofMessagingservices:
Therequestmessageisthecontentoftherequestvariable.Thecontentcanbesimpletext,XML,orbinarydatarepresentedbyaninstanceof<binary
contentref=/>referenceXML.
Responsemessagesaretreatedasbinary,sotheresponsevariablewillcontainaninstanceof<binarycontentref=/>referenceXML,regardlessofthe
actualcontentreceived.
Forexample,iftherequestmessagecontextvariablemyreqisboundtoanXMLdocumentofthefollowingformat:<hello>there</hello>,theoutbound
messagecontainsexactlythispayload.Theresponsemessagecontextvariable(myresp)isboundtoareferenceelementsimilartothefollowing:
<binarycontentref=cid:18507337599555665022ca29e5c.1079b180f61.7fd8/>
8.20.HandlingErrorsastheResultofaServiceCallout
Youcancongureerrorhandlingatthemessageow,pipeline,routenode,andstagelevel.Thetypesoferrorsthatarereceivedfromanexternalserviceas
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 24/45
5/9/2017 3DaysTutorialinOSB|SOALair
Youcancongureerrorhandlingatthemessageow,pipeline,routenode,andstagelevel.Thetypesoferrorsthatarereceivedfromanexternalserviceas
theresultofaservicecalloutincludetransporterrors,SOAPfaults,responsesthatdonotconformtoanexpectedresponse,andsoon.
Thefaultcontextvariableissetdierentlyforeachtypeoferrorreturned.Youcanbuildyourbusinessanderrorhandlinglogicbasedonthecontentofthe
faultvariable.Tolearnmoreabout$fault,seeFaultVariable
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1051816).
8.21.TransportErrors
WhenatransporterrorisreceivedfromanexternalserviceandthereisnoerrorresponsepayloadreturnedtoOracleServiceBusbythetransportprovider
(forexample,inthecasethatanHTTP403errorcodeisreturned),theservicecalloutactionthrowsanexception,whichinturncausesthepipelinetoraisean
error.Thefaultvariableinausercongurederrorhandlerisboundtoamessageforma edsimilarlytothatshowninListing311
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103749).
Listing311ContentsoftheOracleServiceBusfaultVariableTransportError,noErrorResponsePayload
Inthecasethatthereisapayloadassociatedwiththetransporterrorforexample,whenanHTTP500errorcodeisreceivedfromthebusinessserviceand
thereisXMLpayloadintheresponseamessagecontextfaultisgeneratedwiththecustomerrorcode:BEA382502.
ThefollowingconditionsmustbemetforaBEA382502errorresponsecodetobetriggeredastheresultofaresponsefromaservicewhenthatserviceuses
anHTTPorJMStransport:
(HTTP)Theresponsecodemustbeanycodeotherthan200or202.
(JMS)Theresponsemusthaveapropertysettoindicatethatitisanerrorresponsethetransportmetadatastatuscodesetto1indicatesanerror.
Thecontenttypemustbetext/xml.
IftheserviceisAnySoaporWSDLbasedSOAP,thenitmusthaveaSOAPenvelope.ThebodyinsidetheSOAPenvelopemustbeXMLformat;itcannot
betext.
IftheservicetypeisAnyXML,oramessagingserviceoftypetextreturnsXMLcontentwithanonsuccessfulresponsecode(anycodeotherthan200or
202).
IfthetransportisHTTP,theErrorResponseDetailelementwillalsocontaintheHTTPerrorcodereturnedwiththeresponse.TheErrorResponseDetail
elementinthefaultcontainserrorresponsepayloadreceivedfromtheservice.Listing312
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103763)showsanexampleofthe
ErrorResponseDetailelement.
Listing312ContentsoftheOracleServiceBusfaultVariableTransportError,withErrorResponsePayload
Note: TheXMLschemafortheservicecalloutgeneratedfaultisshowninXMLSchemafortheServiceCalloutGeneratedFaultDetails
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103806).
8.22.SOAPFaults
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 25/45
5/9/2017 3DaysTutorialinOSB|SOALair
IncaseanexternalservicereturnsaSOAPfault,theOracleServiceBusruntimesetsupthecontextvariable$faultwithacustomerrorcodeand
descriptionwiththedetailsofthefault.Todoso,thecontentsofthe3elementsunderthe<SOAPENV:Fault>elementintheSOAPfaultareextractedand
usedtoconstructanOracleServiceBusfaultelement.
Takeforexampleascenarioinwhichaservicereturnsthefollowingerror.
Listing313SOAPFaultReturnedFromServiceCallout
The<faultcode>,<faultstring>,and<detail>elementsareextractedandwrappedinan<alsb:ReceivedFault>element.Notethatthefaultcode
elementinListing315(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103806)containsa
QNameanyrelatednamespacedeclarationsarepreserved.IfthetransportisHTTP,theReceivedFaultelementwillalsocontaintheHTTPerrorcode
returnedwiththefaultresponse.
Thegenerated<alsb:ReceivedFault>element,alongwiththecustomerrorcodeandtheerrorstringareusedtoconstructthecontentsofthefault
contextvariable,whichinthisexampletakesaformatsimilartothatshowninListing314
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103791).
Listing314ContentsoftheOracleServiceBusFaultVariableSOAPFault
<ctx:Faultxmlns:ctx="http://www.bea.com/wli/sb/context">
<ctx:errorCode>BEA382500<ctx:errorCode>
<ctx:reason>servicecalloutreceivedasoapFaultresponse</ctx:reason>
<ctx:details>
<alsb:ReceivedFaultxmlns:alsb="http://www.oracle.com/...">
<alsb:faultcode
xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/">SOAPENV:Clien
</alsb:faultcode>
<alsb:faultstring>ApplicationError</alsb:faultstring>
<alsb:detail>
<message>ThatsanError!</message>
<errorcode>1006</errorcode>
</alsb:detail>
<alsb:httpresponsecode>500</alsb:httpresponsecode>
</alsb:ReceivedFault>
</ctx:details>
<ctx:location></ctx:location>
</ctx:Fault>
Note: TheuniqueerrorcodeBEA382500isreservedforthecasewhenservicecalloutactionsreceiveSOAPfaultresponses.
8.23.UnexpectedResponses
Whenaservicereturnsaresponsemessagethatisnotwhattheproxyserviceruntimeexpects,amessagecontextfaultwillbegeneratedandinitializedwith
thecustomerrorcodeBEA382501.ThedetailsofthefaultincludethecontentsoftheSOAPBodyelementoftheresponse.IfthetransportisHTTP,the
ReceivedFaultelementwillalsocontaintheHTTPerrorcodereturnedwiththefaultresponse.
TheXMLschemadenitionoftheservicecalloutgeneratedfaultdetailsisshowninListing315
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1103806).
Listing315XMLSchemafortheServiceCalloutGeneratedFaultDetails
<xs:complexTypename=ReceivedFaultDetail>
<xs:sequence>
<xs:elementname=faultcodetype=xs:QName/>
<xs:elementname=faultstringtype=xs:string/>
<xs:elementname=detailminOccurs=0>
<xs:complexType>
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 26/45
5/9/2017 3DaysTutorialinOSB|SOALair
<xs:complexType>
<xs:sequence>
<xs:anynamespace=##anyminOccurs=0maxOccurs=unboundedprocessContents=lax/>
</xs:sequence>
<xs:anyA ributenamespace=##anyprocessContents=lax/>
</xs:complexType>
</xs:element>
<xs:elementname=h presponsecodetype=xs:intminOccurs=0/>\
type=xs:intminOccurs=0/>
</xs:sequence>
</xs:complexType>
<xs:complexTypename=UnrecognizedResponseDetail>
<xs:sequence>
<xs:elementname=detailminOccurs=0type=xs:string/>
</xs:sequence>
</xs:complexType>
<xs:complexTypename=ErrorResponseDetail>
<xs:sequence>
<xs:elementname=detailminOccurs=0type=xs:string/>
</xs:sequence>
</xs:complexType>
8.24.HandlingErrorsinMessageFlows
Theprocessdescribedinthenextparagraphconstitutesanerrorhandlingpipelineforthestageofanerrorhandler.Inaddition,anerrorpipelinecanbe
denedforapipeline(requestorresponse)orforanentireproxyservice.
Theerrorhandleratthestagelevelisinvokedforhandlinganerror;Ifthestagelevelerrorhandlerisnotabletohandleagiventypeoferror,thepipeline
errorhandlerisinvoked.Ifthepipelinelevelerrorhandleralsofailstohandletheerror,theservicelevelerrorhandlerisinvoked.Iftheservicelevelerror
handleralsofails,theerrorishandledbythesystem.Thefollowingtablesummarizesthescopeoftheerrorhandlersatvariouslevelsinthemessageow.
Level Scope
Stage Handlesalltheerrorswithinastage.
Pipeline Handlesalltheerrorsinapipeline,alongwithanyunhandlederrorsfromanystageinapipeline.
Service Handlesalltheerrorsinaproxyservice,alongwithanyunhandlederrorsinanypipelineinaservice.
Note: AllWSSecurityerrorsarehandledatthislevel.
System Handlesalltheerrorsthatarenothandledanywhereelseinapipeline.
Note: Thereareexceptionstothescopeoferrorhandlers.Forexample,anexceptionthrownbyanonXMLtransformationatthestagelevelisonly
caughtbytheservicelevelerrorhandler.SupposeatransformationoccursthattransformsXMLtoMFLforanoutgoingproxyserviceresponse
message,italwaysoccursinthebindinglayer.Therefore,forexample,ifanonXMLoutputismissingamandatoryeldatthestagelevel,onlya
servicelevelerrorhandlercancatchthiserror.
Formoreinformationonerrormessagesanderrorhandling,seeProxyServices:ErrorHandlers
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyerrors.html)inUsingtheOracleServiceBusConsole.
Youcanhandleerrorsbyconguringatestthatchecksifanassertionistrueandusethereplyactionconguredfalse.Youcanrepeatthistestatvarious
levels.Alsoyoucanhaveanerrorwithoutanerrorhandleratalowerlevelandhandleitthroughanerrorhandleratanhigherlevelinmessageow.
Ingeneral,itiseasiertohandlespecicerrorsatastagelevelofthemessageowanduseerrorhandlersatthehigherlevelformoregeneraldefault
processingoferrorsthatarenothandledatthelowerlevels.Itisgoodpracticetoexplicitlyhandleanticipatederrorsinthepipelinesandallowtheservice
levelhandlertohandleunanticipatederrors.
Note: YoucanonlyhandleWSSecurityrelatederrorsattheservicelevel.
8.25.GeneratingtheErrorMessage,Reporting,andReplying
Apredenedcontextvariable(thefaultvariable)isusedtoholdinformationaboutanyerrorthatoccursduringmessageprocessing.Whenanerroroccurs,
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 27/45
5/9/2017 3DaysTutorialinOSB|SOALair
Apredenedcontextvariable(thefaultvariable)isusedtoholdinformationaboutanyerrorthatoccursduringmessageprocessing.Whenanerroroccurs,
thisvariableispopulatedwithinformationbeforetheappropriateerrorhandlerisinvoked.Thefaultvariableisdenedonlyinerrorhandlerpipelinesand
isnotsetinrequestandresponsepipelines,orinrouteorbranchnodes.Foradditionalinformationabout$fault,seePredenedContextVariables
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1051267).
Intheeventoferrorsforrequest/responsetypeinboundmessages,itisoftennecessarytosendamessagebacktotheoriginatoroutliningthereasonwhyan
erroroccurred.YoucanaccomplishthisbyusingaReplywithFailureactionafterconguringthemessagecontextvariableswiththeresponseyouwantto
send.Forexample,whenanHTTPmessagefails,ReplywithFailuregeneratestheHTTP500status.WhenaJMSmessagefails,ReplywithFailuresetsthe
JMS_BEA_Errorpropertytotrue.TheOracleServiceBuserroractionsarediscussedinProxyServices:ErrorHandlers
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyerrors.html)inUsingtheOracleServiceBusConsole.
AnerrorhandlingpipelineisinvokedifaserviceinvokedbyaproxyservicereturnsaSOAPfaultortransporterror.AnyreceivedSOAPfaultisstoredin
$body,soifaReplywithFailureisexecutedwithoutmodifying$body,theoriginalSOAPfaultisreturnedtotheclientthatinvokedtheservice.Ifareply
actionisnotcongured,thesystemerrorhandlergeneratesanewSOAPfaultmessage.TheproxyservicerecognizesthataSOAPfaultisreturnedbecausea
HTTPerrorstatusisset,ortheJMSpropertySERVER_Errorissettotrue.
Someusecasesrequireerrorreporting.Youcanusethereportactioninthesesituations.Forexample,considerascenarioinwhichtherequestpipeline
reportsamessagefortrackingpurposes,buttheserviceinvokedbytheroutenodefailsafterthereportingaction.Inthiscase,thereportingsystemlogged
themessage,butthereisnoguaranteethatthemessagewasprocessedsuccessfully,onlythatthemessagewassuccessfullyreceived.
YoucanusetheOracleServiceBusConsoletotrackthemessagetoobtainanaccuratepictureofthemessageow.Thisallowsyoutoviewtheoriginal
reportedmessageindicatingthemessagewassubmi edforprocessing,andalsothesubsequentreportederrorindicatingthatthemessagewasnot
processedcorrectly.Tolearnhowtocongureareportactionandusethedatareportedatruntime,seeProxyServices:Actions
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html)inUsingtheOracleServiceBusConsole.
8.26.ExampleofActionConfigurationinErrorHandlers
Thisexampleshowshowyoucancongurethereportandreplyactionsinerrorhandlers.ThemessageowshowninFigure32
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1063705)includesanerrorhandleronthevalidate
loanapplicationstage.TheerrorhandlerinthiscaseisasimplemessageowwithasinglestagecongureditisrepresentedintheOracleServiceBus
ConsoleasshowninFigure32(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1063705).
Figure32ErrorHandlerMessageFlow
Thestageis,inturn,conguredwithactions(replace,report,andreply)asshowninFigure33
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1063796).
Figure33ActionsinStageErrorHandler
Theactionscontrolthebehaviorofthestageinthepipelineerrorhandlerasfollows:
ReplaceThecontentsofaspeciedelementofthebodyvariablearereplacedwiththecontentsofthefaultcontextvariable.Thebodyvariableelement
isspeciedbyanXPathexpression.ThecontentsarereplacedwiththevaluereturnedbyanXQueryexpressioninthiscase
$fault/ctx:reason/text()
ReportMessagesfromthereportingactionarewri entotheOracleServiceBusReportingDataStreamiftheerrorhandlerconguredwiththisaction
isinvoked.TheJMSReportingProviderreportsthemessagesontheOracleServiceBusDashboard.OracleServiceBusprovidesthecapabilitytodeliver
messagedatatooneormorereportingproviders.Messagedataiscapturedfromthebodyofthemessageandfromanyothervariablesassociatedwith
themessage,suchasheaderorinboundvariables.Youcanusethemessagedeliveredtothereportingproviderforfunctionssuchastrackingmessagesor
regulatoryauditing.
Whenanerroroccurs,thecontentsofthefaultcontextvariablearereported.ThekeynameiserrorCode,andthekeyvalueisextractedfromthefault
variableusingthefollowingXPathexpression:./ctx:errorCode.Key/valuepairsarethekeyidentiersthatidentifythesemessagesintheDashboardat
runtime.
Tocongureareportactionandusethedatareportedatruntime,seeProxyServices:Actions
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html)inUsingtheOracleServiceBusConsole.
ReplyAtruntime,animmediatereplyissenttotheinvokeroftheloanGateway3proxyservice(seeFigure33
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1063796))indicatingthatthemessagehada
faultThereplyisWithFailure.
Forcongurationinformation,seeProxyServices:ErrorHandlers
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyerrors.html)inUsingtheOracleServiceBusConsole.
Whenyoudonotknowtheserviceyouneedtoinvokefromtheproxyserviceyouarecreating,youcanusedynamicrouting.
Foranygivenproxyservice,youcanuseoneofthefollowingtechniquestodynamicallyroutemessages:
Inamessageowpipeline,designanXQueryexpressiontodynamicallysetthefullyqualiedservicenameinOracleServiceBusandusethedynamic
routeordynamicpublishactions.
Note:
DynamicRoutingcanbeachievedinaroutenode,whereasdynamicpublishingcanachievedinastageinarequestpipelineoraresponsepipeline.
Withthistechnique,theproxyservicedynamicallyusestheserviceaccountoftheendpointbusinessservicetosendusernamesandpasswordsinits
outboundrequests.Forexample,ifaproxyserviceisroutingarequesttoBusinessServiceA,thentheproxyserviceusestheserviceaccountfrom
BusinessServiceAtosendusernamesandpasswordsinitsoutboundrequest.SeeImplementingDynamicRouting
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 28/45
5/9/2017 3DaysTutorialinOSB|SOALair
BusinessServiceAtosendusernamesandpasswordsinitsoutboundrequest.SeeImplementingDynamicRouting
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1081507).
Congureaproxyservicetorouteorpublishmessagestoabusinessservice.Then,intherequestactionssectionfortherouteactionorpublishaction,
addaRoutingOptionsactionthatdynamicallyspeciestheURIofaservice.
Withthistechnique,tosendusernamesandpasswordsinitsoutboundrequests,theproxyserviceusestheserviceaccountofthestaticallydened
businessservice,regardlessoftheURItowhichtherequestisactuallysent.
Forinformationonhowtousethistechnique,seeImplementingDynamicRouting
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1081507).
Note:
Thistechniqueisusedwhentheoverviewoftheinterfaceisxed.Theoverviewoftheinterfaceincludesmessagetypes,porttypes,andbinding,and
excludestheconcreteinterface.TheconcreteinterfaceisthetransportURLatwhichtheserviceislocated.
ImplementingDynamicRouting
Youcanusedynamicroutingtodeterminethedestinationduringtheruntimeofaproxyservice.ToachievethisyoucanusearoutingtableinanXML
letocreateanXQueryresource.
Note:
InsteadofusingtheXQueryresource,youcanalsodirectlyusetheXMLlefromwhichtheresourceiscreated.
AnXMLleortheXqueryresourcecanbemaintainedeasily.Atruntimeyouprovidetheentryintheroutingtablethatwilldeterminetheroutingor
publishingdestinationoftheproxyservice.TheXMLleortheXQueryresourcecontainsaroutingtable,whichmapsalogicalidentierto(suchasthe
nameofacompany)tothephysicalidentier(thefullyqualiednameoftheserviceinOracleServiceBus).Thelogicalidentier,whichisextractedfrom
themessage,mapsontothephysicalidentier,whichisthenameoftheserviceyouwanttoinvoke.
Note:
Tousethedynamicrouteaction,youneedthefullyqualiednameoftheserviceinOracleServiceBus.
InapipelinethelogicalidentierisobtainedwithanXPathintothemessage.YouassigntheXMLtableintheXQueryresourcetoavariable.You
implementaqueryagainstthevariableintheroutingtabletoextractthephysicalidentierbasedonthecorrespondinglogicalidentier.Usingthis
variableyouwillbeabletoinvoketherequiredservice.Thefollowingsectionsdescribehowtoimplementdynamicrouting.
SampleXMLFile(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1099442).
CreatinganXQueryResourceFromtheSampleXML
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1073290)
CreatingandConguringtheProxyServicetoImplementDynamicRouting
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1073528)
8.27.UsingDynamicRouting
8.28.SampleXMLFile
YoucancreateanXQueryresourcefromthefollowingXMLle.SavethisassampleXquery.xml.
Listing316SampleXMLFile
<routing>
<row>
<logical>Sample</logical>
<physical>default/goldservice</physical>
</row>
<row>
<logical>ABCCorp</logical>
<physical>default/silverservice</physical>
</row>
</routing>
8.29.CreatinganXQueryResourceFromtheSampleXML
Inanactivesession,selectProjectExplorerfromtheleftnavigationpanel.TheProjectViewpageisdisplayed.
SelecttheprojecttowhichyouwanttoaddtheXQueryresource.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 29/45
5/9/2017 3DaysTutorialinOSB|SOALair
SelecttheprojecttowhichyouwanttoaddtheXQueryresource.
IntheProjectViewpage,selecttheXQueryresourcefromtheSelectResourceTypedropdownlist.TheCreateXQuerypageisdisplayed.
IntheResourceNameeld,enterthenameoftheresource.Thisisamandatory.
IntheResourceDescriptioneld,providetheadescriptionfortheresource.Thisisoptional.
IntheXQueryeld,providethepathtotheXMLyouareusingasanXQueryresource.ClickonBrowsetolocatethele.Optionally,youcancopyand
pastetheXMLintheXQueryeld.Thisismandatory.
SavetheXQueryresource.
Activatethesession.
Inanactivesession,selectProjectExplorerfromtheleftnavigationpanel.TheProjectViewpageisdisplayed.
Selecttheprojecttowhichyouwanttoaddtheproxyservice.
IntheProjectViewpage,selecttheProxyServiceresourcefromtheSelectResourceTypedropdownlist.TheGeneralCongurationpageisdisplayed.
IntheServiceNameeldoftheGeneralCongurationpage,enterthenameoftheproxyservice.Thisismandatory.
Selectthetypeofservicebyclickingonthebu onadjacenttovarioustypesofservicesavailableunderServiceType.Formoreinformationonselecting
theservicetype,seeProxyServices:Actions(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html).
ClickFinish.OntheSummarypage,clickSavetosavetheproxyservice.
OntheProjectViewpage,clicktheEditMessageFlowiconagainstthenewlycreatedproxyserviceintheResourcetable.TheEditMessageFlowpageis
displayed.
Clickonthemessageowtoaddapipelinepairtothemessageow.
ClickonRequestPipelineiconselectAddStagefromthemenu.
ClickontheStage1icontoandselectEditStagefromthemenu.TheEditStageCongurationpageappears.
ClickAddActionicon.ChooseAddanActionitemfromthemenu.
ChoosetheAssignactionfromMessageProcessing.
ClickonExpression.TheXQueryExpressionEditorisdisplayed.
ClickonXQueryResources.ThebrowserdisplaysthepagewhereyoucanimporttheXQueryresource.ClickontheBrowsetolocatetheXQuery
resource.
ClickonValidatetovalidatetheimportedXQueryresource.
SavetheimportedXQueryresourceonsuccessfulvalidation.
OntheEditStageCongurationpage,enterthenameofthevariableintheeld.
ThisassignstheXQueryresourcetothisvariable.Thevariablenowcontainstheexternalizedroutingtable.
ClickontheAssignactionicontoaddanotherassignaction.
Note:
Todothisrepeatstep11(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1073907)tostep13
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1073918).
EnterthefollowingXquery:
<ctx:route>
<ctx:serviceisProxy=false>{$routingtable/row[logical/text()=$logicalidentier]/physical/text()}
</ctx:service>
</ctx:route>
Intheabovecode,replace$logicalidentierbytheactualXPathtoextractthelogicalidentierfromthemessage(examplefrom$body).
ClickonValidatetovalidatetheXquery.
SavetheXqueryonsuccessfulvalidation.
OntheEditStageCongurationpage,enterthenameofthevariable(forexample,routeresult)intheeld.
ThisextractstheXMLusedbythedynamicrouteactionintothisvariable.
Clickonthemessageowtoaddaroutenodetotheendofthemessageow.
ClickontheRouteNodeiconandselectEditfromthemenu.
ClicktheAddActionicon.ChooseAddanActionitemfromthemenu.
ChoosetheDynamicRouteaction.
ClickonExpression.TheXQueryExpressionEditorisdisplayed.
Enterthevariablefromstep22(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1093903)(for
example,$routeresult)
OracleServiceBusprovidesreadaccesstodatabasesfromproxyserviceswithoutrequiringyoutowriteacustomEJBorcustomJavacodeandwithout
theneedforaseparatedatabaseproductlikeOraclceDataServiceIntegrator.Youcanusetheexecutesql()functiontomakeasimpleJDBCcalltoa
databasetoperformsimpledatabasereads.AnySQLqueryislegal,fromaquerythatgetsasingletaxrateforthesuppliedlocationtoaquerythatdoesa
complexjointoobtainanorderscurrentstatusfromseveralunderlyingdatabasetables.
Adatabasequerycanbeusedtogetdataformessageenrichment,forroutingdecisions,orforcustomizingthebehaviorofaproxyservice.Takefor
exampleascenarioinwhichanOracleServiceBusproxyservicereceivesrequestforquotemessages.Theproxyservicecanroutetherequestsbasedon
thecustomersprioritytooneofanumberofquotationbusinessservices(say,standard,gold,orplatinumlevelservices).Theproxyservicecanthen
performaSQLbasedaugmentationoftheresultsthatthoseservicesreturnforexample,basedontheselectedshipmethodandtheweightoftheorder,
theshippingcostcanbelookedupandthatcostaddedtotherequestforquotemessage.
fnbea:executesql()(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/xquery.html#wp1101465)describesthesyntaxforthe
functionandprovidesexamplesofitsuse.Theexecutesql()functionreturnstypeddataandautomaticallytranslatesvaluesbetweenSQL/JDBCand
XQuerydatamodels.
YoucanstorethereturnedelementinauserdenedvariableinanOracleServiceBusmessageow.
ThefollowingdatabasesandJDBCdriversaresupportedusingtheexecutesql()function:
IBMDB2/NT8
MicrosoftSQLServer2000,2005
Oracle8.1.x
Oracle9.x,10.x
Pointbase4.4,5.x
Sybase12.5.2and12.5.3
WebLogicType4JDBCdrivers
ThirdpartydriverssupportedbyWebLogicServer
UsenonXAdriversfordatasourcesyouusewiththefnbea:executesql()
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 30/45
5/9/2017 3DaysTutorialinOSB|SOALair
UsenonXAdriversfordatasourcesyouusewiththefnbea:executesql()
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/xquery.html#wp1101465)functionthefunctionsupportsreadonlyaccessto
thedatasources.
WARNING:
InadditiontospecifyinganonXAJDBCdriverclasstousetoconnecttothedatabase,youmustensurethatyoudisableglobaltransactionsandtwo
phasecommit.(GlobaltransactionsareenabledbydefaultintheWebLogicServerconsoleforJDBCdatasources.)Thesespecicationscanbemadefor
yourdatasourceviatheWebLogicServerAdministrationConsole.SeeCreateJDBCDataSources
(h p://download.oracle.com/docs/cd/E12840_01/wls/docs103/ConsoleHelp/taskhelp/jdbc/jdbc_datasources/CreateDataSources.html)intheWebLogic
ServerAdministrationConsoleOnlineHelp.
ForcompleteinformationaboutdatabaseandJDBCdriverssupportinOracleServiceBus,seeSupportedDatabaseCongurations
(h p://edocs.bea.com/platform/suppcongs/congs_al10gr3/osb10gr3/supported_db.html)inSupportedCongurationsforOracleServiceBus.
Databasesotherthanthecoresetdescribedintheprecedinglistingarealsosupported.However,forthecoredatabaseslistedabove,theXQueryengine
doesabe errecognitionandmappingofdatatypestoXQuerytypesthanitdoesforthenoncoredatabasesinsomecases,acoredatabases
proprietaryJDBCextensionsareusedwhenfetchingdata.Forthenoncoredatabases,theXQueryenginereliestotallyonthestandardtypecodes
providedbytheJDBCdriverandstandardJDBCresultsetaccessmethods.
Whendesigningyourproxyservice,youcanenterXQueriesinlineaspartofanactiondenitioninsteadofenteringthemasresources.Youcanalsouse
inlineXQueriesforconditionsinIfThenactionsinmessageows.ForinformationaboutusingtheinlineXQueryeditor,seeCreatingVariable
StructureMappings(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1096693).
ThemessagecontextisasetofvariablesthatholdmessagecontextandinformationaboutmessagesastheyareroutedthroughtheOracleServiceBus.
Together,theheader,body,anda achmentsvariables,(referencedas$header,$bodyand$a achmentsinXQuerystatements)representthemessageasit
owsthroughOracleServiceBus.ThecanonicalformofthemessageisSOAP.EveniftheservicetypeisnotSOAP,themessageappearsasSOAPinthe
OracleServiceBusmessagecontext.
InaMessageContext,$headercontainsaSOAPheaderelementand$bodycontainsaSOAPBodyelement.TheHeaderandBodyelementsarequalied
bytheSOAP1.1orSOAP1.2namespacedependingontheservicetypeoftheproxyservice.AlsoinaMessageContext,$a achmentscontainsawrapper
elementcalleda achmentswithonechilda achmentelementpera achment.Thea achmentelementhasabodyelementwiththeactuala achment.
Whenamessageisreceivedbyaproxyservice,themessagecontentsareusedtoinitializetheheader,body,anda achmentsvariables.ForSOAP
services,theHeaderandBodyelementsaretakendirectlyfromtheenvelopeofthereceivedSOAPmessageandassignedto$headerand$body
respectively.FornonSOAPservices,theentirecontentofthemessageistypicallywrappedinaBodyelement(qualiedbytheSOAP1.1namespace)and
assignedto$body,andanemptyHeaderelement(qualiedbytheSOAP1.1namespace)isassignedto$header.
BinaryandMFLmessagesareinitializeddierently.ForMFLmessages,theequivalentXMLdocumentisinsertedintotheBodyelementthatisassigned
to$body.Forbinarymessages,themessagedataisstoredinternallyandapieceofreferenceXMLisinsertedintotheBodyelementthatisassignedto
$body.ThereferenceXMLlookslike<binarycontentref=/>,wherecontainsauniqueidentierassignedbytheproxyservice.
ThemessagecontextisdenedbyanXMLschema.YoumustuseXQueryexpressionstomanipulatethecontextvariablesinthemessageowthat
denesaproxyservice.
ThepredenedcontextvariablesprovidedbyOracleServiceBuscanbegroupedintothefollowingtypes:
Messagerelatedvariables
Inboundandoutboundvariables
Operationvariable
Faultvariable
Forinformationaboutthepredenedcontextvariables,seePredenedContextVariables
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1051267).
The$bodycontainsmessagepayloadvariable.WhenamessageisdispatchedfromOracleServiceBusyoucandecidethevariables,whoseyouwantto
includeintheoutgoingmessage.ThatdeterminationisdependentuponwhetherthetargetendpointisexpectingaSOAPoranonSOAPmessage:
Forabinary,anytextorXMLmessagecontentinsidetheBodyelementin$bodyissent.
ForMFLmessages,theBodyelementin$bodycontainstheXMLequivalentoftheMFLdocument.
Fortextmessages,theBodyelementin$bodycontainsthetext.Fortexta achments,thebodyelementin$a achmentscontainsthetext.Ifthecontents
areXMLinsteadofsimpletext,theXMLissentasatextmessage.
ForXMLmessages,theBodyelementin$bodycontainstheXML.ForXMLa achments,thebodyelementin$a achmentscontainstheXML.
SOAPmessagesareconstructedbywrappingthecontentsoftheheaderandbodyvariablesinsidea<soap:Envelope>element.(TheSOAP1.1namespace
isusedforSOAP1.1services,whiletheSOAP1.2namespaceisusedforSOAP1.2services.)IfthebodyvariablecontainsapieceofreferenceXML,itis
sent.Thatisthereferencedcontentisnotsubstitutedinthemessage.
FornonSOAPservices,iftheBodyelementof$bodycontainsabinarycontentelement,thenthereferencedcontentstoredinternallyissentasis,
regardlessofthetargetservicetype.
Formoreinformation,seeMessageContext(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html).
Thetypesforthemessagecontextvariablesaredenedbythemessagecontextschema(MessageContext.xsd).Whenworkingwiththemessagecontext
variablesintheOracleXQueryMapper,youneedtoreferenceMessageContext.xsd,whichisavailableinaJARle,ORACLE_HOME/osb_10.3/lib/sb
schemas.jar,andthetransportspecicschemas,whichareavailableat
ORACLE_HOME/osb_10.3/lib/transports/
whereORACLE_HOMErepresentsthedirectoryinwhichyouinstalledOracleServiceBus.
Tolearnaboutthemessagecontextschemaandthetransportspecicschemas,seeMessageContextSchema
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1060634).
Considerthefollowingguidelineswhenyouwanttoinspectoralterthemessagecontext:
InanXQueryexpression,therootelementinavariableisnotpresentinthepathinareferencetoanelementinthatvariable.Forexample,thefollowing
XQueryexpressionobtainstheContentDescriptionofthersta achmentinamessage:
$a achments/ctx:a achment[1]/ctx:contentDescription
Toobtaintheseconda achment
$a achments/ctx:a achment[2]/ctx:body/*
AcontextvariablecanbeemptyoritcancontainasingleXMLelementorastringvalue.However,anXQueryexpressionoftenreturnsasequence.When
youuseanXQueryexpressiontoassignavaluetoavariable,onlytherstelementinthesequencereturnedbytheexpressionisstoredasthevariable
value.Forexample,ifyouwanttoassignthevalueofaWSAddressingMessageIDfromaSOAPheader(assumingthereisoneintheheader)toa
variablenamedidvar,theassignactionspecicationis:
assigndata($header/wsa:messageIDtovariableidvar
Note:
Inthiscase,iftwoWSAddressingMessageIDheadersexist,theidvarvariablewillbeassignedthevalueoftherstone.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 31/45
5/9/2017 3DaysTutorialinOSB|SOALair
Inthiscase,iftwoWSAddressingMessageIDheadersexist,theidvarvariablewillbeassignedthevalueoftherstone.
Thevariables$header,$body,and$a achmentsareneverempty.However,$headercancontainanemptySOAPHeaderelement,$bodycancontainan
emptySOAPBodyelement,and$a achmentscancontainanemptya achmentelement.
Incasesinwhichyouuseatransformationresource(XSLTorXQuery),thetransformationresourceisdenedtotransformthedocumentintheSOAP
bodyofamessage.Tomakethistransformationcaseeasyandecient,theinputparametertothetransformationcanbeanXQueryexpression.For
example,youcanusethefollowingXQueryexpressiontofeedthebusinessdocumentintheBodyelementofamessage($body)asinputtoa
transformation:
$body/*[1]
Theresultofthetransformationcanbeputbackin$bodywithareplaceaction.Thatisreplacethecontentof$body,whichisthecontentoftheBody
element.Formoreinformation,seeXQueryTransformations
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/xquerytransforms.html)andXSLTransformations
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/xsl ransforms.html)inUsingtheOracleServiceBusConsole.
Inadditiontoinsertingorreplacingasingleelement,youcanalsoinsertorreplaceaselectedsequenceofelementsusinganinsertorreplaceaction.You
cancongureanXQueryexpressiontoreturnasequenceofelements.Forexample,youcanuseinsertandreplaceactionstocopyasetoftransport
headersfrom$inboundto$outbound.Forinformationonaddinganaction,seeAddinganActioninProxyServices:Actions
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html)inUsingtheOracleServiceBusConsole.Foranexample,see
CopyingJMSPropertiesFromInboundtoOutbound
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1041396).
CopyingJMSPropertiesFromInboundtoOutbound
Itisassumedthattheinterfacesoftheproxyservicesandoftheinvokedbusinessservicemaybedierent.Therefore,OracleServiceBusdoesnot
propagateanyinformation(suchasthetransportheadersandJMSproperties)fromtheinboundvariabletotheoutboundvariable.
Thetransportheadersfortheproxyservicesrequestandresponsemessagesarein$inboundandthetransportheadersfortheinvokedbusinessservices
requestandresponsearein$outbound.
Forexample,thefollowingXQueryexpressioncanbeusedinacasewheretheuserdenedJMSpropertiesforaonewaymessage(aninvocationwithno
response)needtobecopiedfrominboundmessagetooutboundmessage:
Usethetransportheadersactiontoset
$inbound/ctx:transport/ctx:request/tp:headers/tp:userheader
astherstchildof:
./ctx:transport/ctx:request/tp:headers
intheoutboundvariable.
Tolearnhowtocongurethetransportheaderaction,see:
TransportHeadersinProxyServices:Actions(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html)inUsing
theOracleServiceBusConsole.
WorkingwithVariableStructures
Thefollowingsectionsdescribe
UsingtheInlineXQueryExpressionEditor
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1059622)
UsingVariableStructures(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1137136)
CreatingVariableStructureMappings
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1096693)
OracleServiceBusallowsyoutoimportXQueriesthathavebeencreatedwithanexternaltoolsuchastheOracleXQueryMapper.Youcanusethese
XQueriesanywhereintheproxyservicemessageowbybindingtheXQueryresourceinputtoanInlineXQuery,andbindingtheXQueryresource
outputtoanactionthatusestheresultastheinput;forexample,theassign,replace,orinsertactions.
However,youcanentertheXQueryinlineaspartoftheactiondenitioninsteadofenteringtheXQueryasaresource.YoucanalsouseInlineXQueries
fortheconditioninanIfThenaction.
UsetheInlineXQueryExpressionEditortoentersimpleXQueriesthatconsistofthefollowing:
FragmentsofXMLwithembeddedXQueries.
Simplevariablepathsalongthechildaxis.
Note:
FormorecomplexXQueries,itisrecommendedthatyouusetheXQueryMapper,especiallyifyouarenotfamiliarwithXQuery.
InlineXQueriescanbeusedeectivelyto:
CreatevariablestructuresbyusingtheInlineXQueryExpressionEditor.SeeUsingVariableStructures
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1137136).
ExtractoraccessabusinessdocumentorRPCparameterfromtheSOAPenvelopeelementsin$headeror$body.
Extractoraccessana achmentdocumentin$a achments.
SetuptheparametersofaservicecalloutactionbyextractingitfromtheSOAPenvelope.
InserttheresultparameterofaservicecalloutactionintotheSOAPenvelope.
ExtractasequencefromtheSOAPenvelopetodriveaforloop.
UpdateaniteminthesequenceinaforloopwithanUpdateaction.
Note:
YoucanalsousetheInlineXQueryExpressionEditortocreatevariablestructures.Formoreinformation,seeUsingVariableStructures
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1137136).
OracleServiceBusallowsyoutoimportXQueriesthathavebeencreatedwithanexternaltoolsuchastheOracleXQueryMapper.Youcanusethese
XQueriesanywhereintheproxyservicemessageowbybindingtheXQueryresourceinputtoaninlineXQuery,andbindingtheXQueryresource
outputtoanactionthatusestheresultastheactioninput;forexample,theassign,replace,orinsertactions.However,youcanentertheXQueryinlineas
partoftheactiondenitioninsteadofenteringtheXQueryasaresource.YoucanalsouseinlineXQueriesfortheconditioninanIfThenaction.
TheinlineXQueryandXPatheditorsallowyoutodeclareavariablesstructurebymappingittoatypeorelementandthencreatingpathexpressions
withadraganddropactionfromthegraphicalrepresentationofthestructure.Youcanalsoenterthepathexpressionsmanually.
Youcanusethisfeaturedirectlyforalluserdenedvariables,aswellas$inbound,$outbound,and$fault.However,youcannotuseitdirectlytoaccess
XMLa achmentsin$a achments,headersin$header,ordocumentsandRPCparametersin$body,withoneexceptionyoucanuseitdirectlytoaccess
documentsandparametersin$bodyforrequestmessagesreceivedbyaWSDLproxyservice.
Tolearnmoreaboutcreatingvariablestructures,seeCreatingVariableStructureMappings
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1096693).
TolearnmoreaboutXQueryenginesupportandtherelationshipwiththeOracleDataServiceIntegratorfunctionsandoperators,seeXQuery
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 32/45
5/9/2017 3DaysTutorialinOSB|SOALair
TolearnmoreaboutXQueryenginesupportandtherelationshipwiththeOracleDataServiceIntegratorfunctionsandoperators,seeXQuery
Implementation(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/xquery.html).
YoutypicallyusetheInlineXQueryExpressionEditortoentersimpleXQueriesthatconsistofthefollowing:
FragmentsofXMLwithembeddedXQueries.
Simplevariablepathsalongthechildaxis.
Note:
FormorecomplexXQueries,werecommendthatyouusetheOracleXQueryMapper,aneditorwithdraganddropfunctionality.SeeTransformingData
UsingtheXQueryMapper(h p://download.oracle.com/docs/cd/E13160_01/wli/docs10gr3/dtguide/index.html)inTransformingDataUsingtheXQuery
Mapper.
ExamplesofgoodusesofinlineXQueriesare:
ExtractoraccessabusinessdocumentorRPCparameterfromtheSOAPenvelopeelementsin$headeror$body.
Extractoraccessana achmentdocumentin$a achments.
SetuptheparametersofaservicecalloutbyextractingitfromtheSOAPenvelope.
FoldtheresultparameterofaservicecalloutintotheSOAPenvelope.
ExtractasequencefromtheSOAPenvelopetodriveaforloop.
UpdateaniteminthesequenceinaforloopwithanUpdateaction.
YoucanalsousetheInlineXQueryExpressionEditortocreatevariablestructures.Formoreinformation,seeUsingVariableStructures
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1137136).
YoucanusetheInlineXQueryExpressionEditortocreatevariablestructures,withwhichyoudenethestructureofagivenvariablefordesign
purposes.Forexample,itiseasiertobrowsetheXPathvariableintheconsoleratherthanviewingtheXMLschemaoftheXPathvariable.
Note:
Itisnotnecessarytocreatevariablestructuresforyourruntimetowork.Variablestructuresdenethestructureofthevariableorthevariablepathbutdo
notcreatethevariable.Variablesarecreatedatruntimeasthetargetoftheassignactioninthestage.
Inatypicalprogramminglanguage,thescopeofvariablesisstatic.Theirnamesandtypesareexplicitlydeclared.Thevariablecanbeaccessedanywhere
withinthestaticscope.
InOracleServiceBus,therearesomepredenedvariables,butyoucanalsodynamicallycreatevariablesandassignvaluetothemusingtheassignaction
orusingtheloopvariableintheforloop.Whenavalueisassignedtoavariable,thevariablecanbeaccessedanywhereintheproxyservicemessage
ow.Thevariabletypeisnotdeclaredbutthetypeisessentiallytheunderlyingtypeofthevalueitcontainsatanypointintime.
Note:
Thescopeoftheforloopvariableislimitedandcannotbeaccessedoutsidethestage.
WhenyouusetheInlineXQueryExpressionEditor,theXQueryhaszeroormoreinputsandoneoutput.Becauseyoucandisplaythestructureofthe
inputsandthestructureoftheoutputvisuallyintheExpressionEditoritself,youdonotneedtoopentheXMLschemaorWSDLresourcestoseetheir
structurewhenyoucreatetheInlineXQuery.Thegraphicalstructuredisplayalsoenablesyoutodraganddropsimplevariablepathsalongthechildaxis
withoutpredicates,intothecomposedXQuery.
Eachvariablestructuremappingentryhasalabelandmapsavariableorvariablepathtooneormorestructures.Thescopeofthesemappingsisthe
stageorroutenode.Becausevariablesarenotstaticallytyped,avariablecanhavedierentstructuresatdierentpoints(oratthesamepoint)inthestage
orroutenode.Therefore,youcanmapavariableoravariablepathtomultiplestructures,eachwithadierentlabel.Toviewthestructure,selectthe
correspondinglabelwithadropdownlist.
Note:
YoucanalsocreatevariablestructuremappingsintheInlineXPathExpressionEditor.However,althoughthevariableoravariablepathismappedtoa
structure,theXPathsgeneratedwhenyouselectfromthestructureareXPathsrelativetothevariable.AnexampleofarelativeXPathis
./ctx:a achment/ctx:body.
Thefollowingsectionsdescribehowtocreateseveraltypesofvariablestructuremappings:
SampleWSDL(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1055812)
CreatingtheResourcesYouNeedfortheExamples
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1058217)
Example1:SelectingaPredenedVariableStructure
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1072243)
Example2:CreatingaVariableStructureThatMapsaVariabletoaType
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1056947)
Example3:CreatingaVariableStructurethatMapsaVariabletoanElement
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1086388)
Example4:CreatingaVariableStructureThatMapsaVariabletoaChildElement
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1055550)
Example5:CreatingaVariableStructurethatMapsaVariabletoaBusinessService
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1055565)
Example6:CreatingaVariableStructureThatMapsaChildElementtoAnotherChildElement
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1055578)
8.30.CreatingandConfiguringtheProxyServicetoImplementDynamicRouting
8.31.AccessingDatabasesUsingXQuery
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 33/45
5/9/2017 3DaysTutorialinOSB|SOALair
8.32.UnderstandingMessageContext
8.33.MessageContextComponents
8.34.GuidelinesforViewingandAlteringMessageContext
8.35.UsingtheInlineXQueryExpressionEditor
8.36.InlineXQueries
8.37.UsesoftheInlineXQueryExpressionEditor
8.38.UsingVariableStructures
8.39.CreatingVariableStructureMappings
8.39.1.SampleWSDL
ThissampleWSDLisusedinmostoftheexamplesinthissection.YouneedtosavethisWSDLasaresourceinyourconguration.Formoreinformation,see
CreatingtheResourcesYouNeedfortheExamples
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1058217).
Listing317SampleWSDL
<denitions
name=samplewsdl
targetNamespace=h p://example.org”(h p://example.org”);
xmlns=h p://schemas.xmlsoap.org/wsdl/”(h p://schemas.xmlsoap.org/wsdl/”);
xmlns:s0=h p://www.oracle.com”(h p://www.oracle.com”);
xmlns:s1=h p://example.org”(h p://example.org”);
xmlns:soap=h p://schemas.xmlsoap.org/wsdl/soap/>(h p://schemas.xmlsoap.org/wsdl/soap/>);
<types>
<xs:schema
a ributeFormDefault=unqualied
elementFormDefault=qualied
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 34/45
5/9/2017 3DaysTutorialinOSB|SOALair
elementFormDefault=qualied
targetNamespace=h p://www.oracle.com”(h p://www.oracle.com”);
xmlns:xs=h p://www.w3.org/2001/XMLSchema>(h p://www.w3.org/2001/XMLSchema>);
<xs:elementname=POtype=s0:POType/>
<xs:complexTypename=POType>
<xs:all>
<xs:elementname=idtype=xs:string/>
<xs:elementname=nametype=xs:string/>
</xs:all>
</xs:complexType>
<xs:elementname=Invoicetype=s0:InvoiceType/>
<xs:complexTypename=InvoiceType>
<xs:all>
<xs:elementname=idtype=xs:string/>
<xs:elementname=nametype=xs:string/>
</xs:all>
</xs:complexType>
</xs:schema>
</types>
<messagename=POTypeMsg>
<partname=POtype=s0:POType/>
</message>
<messagename=InvoiceTypeMsg>
<partname=InvReturntype=s0:InvoiceType/>
</message>
<portTypename=POPortType>
<operationname=GetInvoiceType>
<inputmessage=s1:POTypeMsg/>
<outputmessage=s1:InvoiceTypeMsg/>
</operation>
</portType>
<bindingname=POBindingtype=s1:POPortType>
<soap:bindingstyle=rpctransport=h p://schemas.xmlsoap.org/soap/h p/>(h p://schemas.xmlsoap.org/soap/h p/>);
<operationname=GetInvoiceType>
<soap:operationsoapAction=h p://example.com/GetInvoiceType/>(h p://example.com/GetInvoiceType/>);
<input>
<soap:bodyuse=literal/>
</input>
<output>
<soap:bodyuse=literal/>
</output>
</operation>
</binding>
</denitions>
8.40.CreatingtheResourcesYouNeedfortheExamples
Tomakeuseoftheexamplesthatfollow,yousavethesampleWSDLasaresourceinyourcongurationandcreatethesamplebusinessserviceandproxy
servicethatusethesampleWSDL.
TheinstructionsthatfollowtellhowtoaccomplishthetasksintheOracleServiceBusConsole:
SavetheWSDLasaResource(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1057308)
CreateaProxyServiceThatUsestheSampleWSDL
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1056885)
BuildaMessageFlowfortheSampleProxyService
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1059091)
CreateaBusinessServiceThatUsestheSampleWSDL
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1095714)
8.41.SavetheWSDLasaResource
1.IntheleftnavigationpaneintheOracleServiceBusConsole,underChangeCenter,clickCreatetocreateanewsessionformakingchangestothecurrent
conguration.
2.Intheleftnavigationpane,clickProjectExplorer.
3.IntheProjectViewpage,clicktheprojecttowhichyouwanttoaddtheWSDL.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 35/45
5/9/2017 3DaysTutorialinOSB|SOALair
3.IntheProjectViewpage,clicktheprojecttowhichyouwanttoaddtheWSDL.
4.IntheProjectViewpage,intheCreateResourceeld,selectWSDLunderInterface.
5.IntheCreateaNewWSDLResourcepageintheResourceNameeld,enterSampleWSDL.Thisisarequiredeld.
6.IntheWSDLeld,copyandpastethetextfromthesampleWSDLintothiseld.
Note: Thisisarequiredeld.
1.ClickSave.ThenewWSDLSampleWSDLisincludedinthelistofresourcesandsavedinthecurrentsession.Youmustnowcreateaproxyservicethat
usesthisWSDL,seeCreateaProxyServiceThatUsestheSampleWSDL
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1056885).
2.Intheleftnavigationpane,clickProjectExplorer.
3.IntheProjectViewpage,selecttheprojecttowhichyouwanttoaddtheproxyservice.
4.IntheProjectViewpage,intheCreateResourceeld,selectProxyServiceunderService.
5.IntheEditaProxyServiceGeneralCongurationpage,intheServiceNameeld,enterProxywithSampleWSDL.Thisisarequiredeld.
6.IntheServiceTypeeld,whichdenesthetypesandpackagingofthemessagesexchangedbytheservice:
1.SelectWSDLWebServicefromunderCreateaNewService.
2.ClickBrowse.TheWSDLBrowserisdisplayed.
3.SelectSampleWSDL,thenselectPOBindingintheSelectWSDLDenitionspane.
4.ClickSubmit.
5.KeepthedefaultvaluesforallothereldsontheGeneralCongurationpage,thenclickNext.
6.KeepthedefaultvaluesforalleldsontheTransportCongurationpages,thenclickNext.
7.IntheOperationSelectionCongurationpage,makesureSOAPBodyTypeisselectedintheSelectionAlgorithmeld,thenclickNext.
8.Reviewthecongurationdatathatyouhaveenteredforthisproxyservice,thenclickSave.ThenewproxyserviceProxywithSampleWSDLis
includedinthelistofresourcesandsavedinthecurrentsession.Tobuildmessageowforthisproxyservice,seeBuildaMessageFlowforthe
SampleProxyService(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1059091).
9.IntheProjectViewpage,intheActionscolumn,clicktheEditMessageFlowiconfortheProxywithSampleWSDLproxyservice.
10.IntheEditMessageFlowpage,clicktheProxywithSampleWSDLicon,thenclickAddPipelinePair.PipelinePairNode1isdisplayed,whichincludes
requestandresponsepipelines.
11.ClicktheRequestPipelineicon,thenclickAddStage.TheStageStage1isdisplayed.
12.ClickSave.ThebasicmessageowiscreatedfortheProxywithSampleWSDLproxyservice.
13.Intheleftnavigationpane,clickProjectExplorer.TheProjectViewpageisdisplayed.
14.Selecttheprojecttowhichyouwanttoaddthebusinessservice.
15.FromtheProjectViewpage,intheCreateResourceeld,selectBusinessServicefromunderService.TheEditaBusinessServiceGeneral
Congurationpageisdisplayed.
16.IntheServiceNameeld,enterBusinesswithSampleWSDL.Thisisarequiredeld.
17.IntheServiceTypeeld,whichdenesthetypesandpackagingofthemessagesexchangedbytheservice,dothefollowing:
1.SelectWSDLWebServicefromunderCreateaNewService.
2.ClickBrowse.TheWSDLBrowserisdisplayed.
3.SelectSampleWSDL,thenselectPOBindingintheSelectWSDLDenitionspane.
4.ClickSubmit.
5.KeepthedefaultvaluesforallothereldsontheGeneralCongurationpage,thenclickNext.
6.EnteranendpointURIintheEndpointURIeldontheTransportCongurationpage.
ClickAdd,andthenclickNext.
7.UsethedefaultvaluesforalleldsontheSOAPBindingCongurationpage.
ClickNext.
8.Reviewthecongurationdatathatyouhaveenteredforthisbusinessservice,andthenclickSave.Thenewbusinessservice
BusinesswithSampleWSDLisincludedinthelistofresourcesandissavedinthecurrentsession.
9.Fromtheleftnavigationpane,clickActivateunderChangeCenter.Thesessionendsandthecongurationisdeployedtoruntime.Youarenow
readytousetheexamplescontinueinExample1:SelectingaPredenedVariableStructure
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1072243).
8.42.CreateaProxyServiceThatUsestheSampleWSDL
8.43.BuildaMessageFlowfortheSampleProxyService
8.44.CreateaBusinessServiceThatUsestheSampleWSDL
8.45.Example1:SelectingaPredefinedVariableStructure
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 36/45
5/9/2017 3DaysTutorialinOSB|SOALair
Inthisexample,youselectapredenedvariablestructureusingtheproxyserviceProxyWithSampleWSDL,whichhasaservicetypeWSDLWebServicethat
usesthebindingPOBindingfromSampleWSDL.
Theproxyservicemessageowneedstoknowthestructureofthemessageinordertomanipulateit.Toachievethis,OracleServiceBusautomatically
providesapredenedstructurethatmapsthebodyvariabletotheSOAPbodystructureasdenedbytheWSDLoftheproxyserviceforallthemessagesin
theinterface.Thispredenedstructuremappingislabeledbody.
Note: Thispredenedstructureisalsosupportedformessagingserviceswithatypedinterface.
Toselectapredenedvariablestructure:
IntheVariableStructurespanelontheXQueryExpressionEditorpage,selectbodyfromthedropdownlistofbuiltinstructures.
ThevariablestructurebodyisdisplayedinFigure34
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1056944).
Figure34VariableStructuresbody
8.46.Example2:CreatingaVariableStructureThatMapsaVariabletoaType
SupposetheproxyserviceProxyWithSampleWSDLinvokesaservicecallouttothebusinessserviceBusinessWithSampleWSDL,whichalsohasaservice
typeWSDLWebServicethatusesthebindingPOBindingfromSampleWSDL.TheoperationGetInvoiceTypeisinvoked.
Inthisexample,themessageowneedstoknowthestructureoftheresponseparameterinordertomanipulateit.Toachievethis,youcancreateanew
variablestructurethatmapstheresponseparametervariabletothetypeInvoiceType.
Tomapavariabletoatype:
1.IntheVariableStructurespanel,clickAddNewStructure.AdditionaleldsaredisplayedinFigure35
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1057571).
Figure35VariableStructuresAddaNewStructure
1.SelecttheXMLType.
2.IntheStructureLabeleld,enterInvoiceTypeasthedisplaynameforthevariablestructureyouwanttocreate.Thisdisplaynameenablesyoutogivea
meaningfulnametothestructuresoyoucanrecognizeitatdesigntimebutithasnoimpactatruntime.
3.IntheStructurePatheld,enter$InvoiceTypeasthepathofthevariableatruntime.
4.ToselectthetypeInvoiceType,dothefollowing:
1.UndertheTypeeld,selecttheappropriateradiobu on,thenselectWSDLTypefromthedropdownlist.
2.ClickBrowse.TheWSDLBrowserisdisplayed.
3.IntheWSDLBrowser,selectSampleWSDL,thenselectInvoiceTypeunderTypesintheSelectWSDLDenitionspane.
4.ClickSubmit.InvoiceTypeisdisplayedunderyourselectionWSDLType.
5.ClickAdd.ThenewvariablestructureInvoiceTypeisincludedunderXMLTypeinthedropdownlistofvariablestructures.
ThevariablestructureInvoiceTypeisdisplayedinFigure36
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1057543).
Figure36VariableStructuresInvoiceType
8.47.Example3:CreatingaVariableStructurethatMapsaVariabletoanElement
SupposeatemporaryvariablehastheelementInvoicedescribedintheSampleWSDLWSDL.Inthisexample,theProxyWithSampleWSDLmessageow
needstoaccessthisvariable.Toachievethis,youcancreateanewvariablestructurethatmapsthevariabletotheelementInvoice.
Tomapavariabletoanelement:
1.IntheVariableStructurespanel,clickAddNewStructure.
2.MakesureyouselecttheXMLType.
3.IntheStructureLabeleld,enterInvoiceasthemeaningfuldisplaynameforthevariablestructureyouwanttocreate.
4.IntheStructurePatheld,enter$Invoiceasthepathofthevariablestructureatruntime.
5.ToselecttheelementInvoice,dothefollowing:
1.FortheTypeeld,makesureyouselecttheappropriateradiobu on.ThenselectWSDLElementfromthedropdownlist.
2.ClickBrowse.
3.IntheWSDLBrowser,selectSampleWSDL,thenselectInvoiceunderElementsintheSelectWSDLDenitionspane.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 37/45
5/9/2017 3DaysTutorialinOSB|SOALair
3.IntheWSDLBrowser,selectSampleWSDL,thenselectInvoiceunderElementsintheSelectWSDLDenitionspane.
4.ClickSubmit.InvoiceisdisplayedunderyourselectionWSDLElement.
5.ClickAdd.ThenewvariablestructureInvoiceisincludedunderXMLTypeinthedropdownlistofvariablestructures.
ThevariablestructureInvoiceisdisplayedinFigure37
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1057691).
Figure37VariableStructuresInvoice
8.48.Example4:CreatingaVariableStructureThatMapsaVariable
toaChildElement
TheProxyWithSampleWSDLproxyserviceroutestothedocumentstyleAnySOAPbusinessservicethatreturnsthePurchaseOrderintheSOAPbody.In
thisexample,theProxyWithSampleWSDLproxyservicemessageowmustthenmanipulatetheresponse.Toachievethis,youcancreateanewstructure
thatmapsthebodyvariabletothePOelement,andspecifythePOelementasachildelementofthevariable.Youneedtospecifyitasachildelement
becausethebodyvariablecontainstheSOAPBodyelementandthePOelementisachildoftheBodyelement.
Tomapavariabletoachildelement:
1.IntheVariableStructurespanel,clickAddNewStructure.
2.MakesureyouselecttheXMLType.
3.IntheStructureLabeleld,enterbodytoPOasthemeaningfuldisplaynameforthevariablestructureyouwanttocreate.
4.IntheStructurePatheld,enter$bodyasthepathofthevariablestructureatruntime.
5.ToselectthePOelement:
1.UndertheTypeeld,makesureyouselecttheappropriateradiobu on,andthenselectWSDLElementfromthedropdownlist.
2.ClickBrowse.
3.IntheWSDLBrowser,selectSampleWSDL,thenselectPOunderElementsintheSelectWSDLDenitionspane.
4.ClickSubmit.
5.SelecttheSetaschildcheckboxtosetthePOelementasachildofthebodytoPOvariablestructure.
6.ClickAdd.ThenewvariablestructurebodytoPOisincludedunderXMLTypeinthedropdownlistofvariablestructures.
ThevariablestructurebodytoPOisdisplayedinFigure38
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1058612).
Figure38VariableStructuresbodytoPO
8.49.Example5:CreatingaVariableStructurethatMapsaVariable
toaBusinessService
TheProxyWithSampleWSDLproxyserviceroutesthemessagetotheBusinessWithSampleWSDLbusinessservice,whichalsohasaservicetypeWSDLWeb
ServicethatusesthebindingPOBindingfromSampleWSDL.Inthisexample,themessageowmustthenmanipulatetheresponse.Toachievethis,youcan
deneanewstructurethatmapsthebodyvariabletotheBusinessWithSampleWSDLbusinessservice.ThisresultsinamapofthebodyvariabletotheSOAP
bodyforallthemessagesintheWSDLinterfaceoftheservice.
Note: Thismappingisalsosupportedformessagingserviceswithatypedinterface.
Tomapavariabletoabusinessservice:
1.IntheVariableStructurespanel,clickAddNewStructure.
2.SelectServiceInterface.
3.IntheStructureLabeleld,enterBusinessServiceasthemeaningfuldisplaynameforthevariablestructure.
4.IntheStructurePatheld,$bodyisalreadysetasthedefault.Thisisthepathofthevariablestructureatruntime.
5.Toselectthebusinessservice,dothefollowing:
1.UndertheServiceeld,clickBrowse.TheServiceBrowserisdisplayed.
2.IntheServiceBrowser,selecttheBusinessWithSampleWSDLbusinessservice,thenclickSubmit.ThebusinessserviceisdisplayedundertheService
eld.
3.IntheOperationeld,selectAll.
4.ClickAdd.ThenewvariablestructureBusinessServiceisincludedunderServiceInterfaceinthedropdownlistofvariablestructures.
ThevariablestructureBusinessServiceisdisplayedinFigure39
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1058744).
Figure39VariableStructuresBusinessService
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 38/45
5/9/2017 3DaysTutorialinOSB|SOALair
8.50.Example6:CreatingaVariableStructureThatMapsaChildElementtoAnother
ChildElement
$a achments/ctx:a achment/ctx:body
Youcanselectandcopythebodyelementfromthepredeneda achmentsstructure,pastethiselementasthevariablepathtobemappedinthenew
mappingdenition.
Tomapachildelementtoanotherchildelement:
1.IntheVariableStructurespanel,selecta achmentsfromthedropdownlistofbuiltinstructures.
Thevariablestructurea achmentsisdisplayedinFigure310
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1058852).
Figure310VariableStructuresa achments
1.Selectthebodychildelementinthea achmentsstructure.ThevariablepathofthebodyelementisdisplayedinthePropertyInspectorontherightside
ofthepage:
$a achments/ctx:a achment/ctx:body
1.Copythevariablepathofthebodyelement.
2.IntheVariableStructurespanel,clickAddNewStructure.
3.SelecttheXMLType.
4.IntheStructureLabeleld,enterPOa achmentasthemeaningfuldisplaynameforthisvariablestructure.
5.IntheStructurePatheld,pastethevariablepathofthebodyelement:
$a achments/ctx:a achment/ctx:body
Thisisthepathofthevariablestructureatruntime.
1.ToselectthePOelement:
1.UndertheTypeeld,makesuretheappropriateradiobu onisselected,thenselectWSDLElement.
2.ClickBrowse.
3.IntheWSDLBrowser,selectSampleWSDL,thenselectPOunderElementsintheSelectWSDLDenitionspane.
4.ClickSubmit.
5.SelecttheSetaschildcheckboxtosetthePOelementasachildofthebodyelement.
6.ClickAdd.ThenewvariablestructurePOa achmentisincludedunderXMLTypeinthedropdownlistofvariablestructures.
7.Iftherearemultiplea achments,addanindextothereferencewhenyouuseeldsfromthisstructuredvariableinyourXQueries.Forexample,if
youdragthePOeldtotheXQueryeld,butasPOwillbetheseconda achment,changetheinsertedvaluefrom
$a achments/ctx:a achment/ctx:body/oracle:PO/oracle:id
to
$a achments/ctx:a achment[2]/ctx:body/oracle:PO/oracle:id
8.51.QualityofService
ThefollowingsectionsdiscussqualityofservicefeaturesinOracleServiceBusmessaging:
DeliveryGuarantees(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1065307)
OutboundMessageRetries(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1065437)
8.52.DeliveryGuarantees
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 39/45
5/9/2017 3DaysTutorialinOSB|SOALair
OracleServiceBussupportsreliablemessaging.Whenmessagesareroutedtoanotherservicefromaroutenode,thedefaultqualityofservice(QoS)isexactly
onceiftheproxyservicetransportisdenedasJMS/XA;otherwisebesteortQoSissupported.
QualityofserviceissetinthequalityOfServiceelementinthe$outboundcontextvariable.
ThefollowingdeliveryguaranteetypesareprovidedinOracleServiceBus,showninTable39
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1072342).
Delivery Description
Reliability
Exactly Exactlyoncereliabilitymeansthatmessagesaredeliveredfrominboundtooutboundexactlyonce,assumingaterminatingerrordoesnot
once occurbeforetheoutboundmessagesendisinitiated.Exactlyoncemeansreliabilityisoptimized.
Exactlyoncedeliveryreliabilityisahint,notadirective.Whenexactlyonceisspecied,exactlyoncereliabilityisprovidedifpossible.Ifexactly
onceisnotpossible,thenatleastoncedeliverysemanticsarea empted;ifthatisnotpossible,besteortdeliveryisperformed.
ThedefaultvalueofthequalityOfServiceelementisexactlyonceforaroutenodeactionforthefollowinginboundtransports:
email
FTP
File
JMS/XA
SFTP
TransactionalTuxedo
Note: DonotretrytheoutboundtransportwhentheQoSisexactlyonce
Atleast Atleastoncesemanticsmeansthemessageisdeliveredtotheoutboundfromtheinboundatleastonce,assumingaterminatingerrordoesnot
once occurbeforetheoutboundmessagesendisinitiated.Deliveryisconsideredsatisedevenifthetargetservicerespondswithatransportlevel
error.Howeveritisnotsatisedinthecaseofatimeout,afailuretoconnect,orabrokencommunicationlink.IffailoverURLsarespecied,
atleastoncesemanticsisprovidedwithrespecttoatleastoneoftheURLs.
Atleastoncedeliverysemanticsisa emptedifexactlyonceisnotpossiblebutthequalityOfServiceelementisexactlyonce.
Besteort Besteortmeansthatthereisnoreliablemessagingandthereisnoeliminationofduplicatemessageshowever,performanceisoptimized.It
isperformedifthequalityOfServiceelementisbesteort.Besteortdeliveryisalsoperformedifexactlyonceandatleastoncedelivery
semanticsarenotpossiblebutthequalityOfServiceelementisexactlyonce.
ThedefaultvalueofthequalityOfServiceelementforaroutenodeisbesteortforthefollowinginboundtransports:
HTTP
JMS/nonXA
NonTransactionalTuxedo
ThedefaultvalueofthequalityOfServiceelementisalwaysbesteortforthefollowing:
Servicecalloutactionalwaysbesteort,butcanbechangedifrequired.
Publishactiondefaultstobesteort,modiable
Note: WhenthevalueofthequalityOfServiceelementisbesteortforapublishaction,allerrorsareignored.However,whenthevalue
ofthequalityOfServiceelementisbesteortforaroutenodeactionoraServicecalloutaction,anyerrorwillraiseanexception.
Formoredetailedinformationaboutqualityofserviceforothertransports,seethedocumentationforthetransport,atOracleServiceBusTransports
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/transports.html).
8.53.OverridingtheDefaultElementAttribute
Tooverridethedefaultexactlyoncequalityofservicea ribute,youmustsetthequalityOfServiceintheoutboundmessagecontextvariable($outbound).For
moreinformation,seeMessageContextSchema(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1060634).
YoucanoverridethedefaultqualityOfServiceelementa ributeforthefollowing:
Routenodeaction
Publishaction
Servicecallout
TooverridethequalityOfServiceelementa ribute,youmustusetherouteoptionsactiontorouteorpublish,andalsoselectthecheckboxforaservice
calloutaction.SeeMessageContextSchema(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1060634).
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 40/45
5/9/2017 3DaysTutorialinOSB|SOALair
8.54.DeliveryGuaranteeRules
Thedeliveryguaranteesupportedwhenaproxyservicepublishesamessageorroutesarequesttoabusinessservicedependsonthefollowingconditions:
ThevalueofthequalityOfServiceelement.
Theinboundtransport(andconnectionfactory,ifapplicable).
Theoutboundtransport(andconnectionfactory,ifapplicable).
However,iftheinboundproxyserviceisaLocalTransportandisinvokedbyanotherproxyservice,theinboundtransportoftheinvokingproxyserviceis
responsibleforthedeliveryguarantee.Thatisbecauseaproxyservicethatinvokesanotherproxyserviceisoptimizedintoadirectinvocationifthetransport
oftheinvokedproxyserviceisaLocalTransport.Formoreinformationontransportprotocols,seeProxyServices
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyservices.html)andBusinessServices
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/businessServices.html)inUsingtheOracleServiceBusConsole.
Note: Nodeliveryguaranteeisprovidedforresponsesfromaproxyservice.
Thefollowingrulesgoverndeliveryguarantees,showninTable310
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp367496).
DeliveryGuarantee Rule
Provided
Exactlyonce TheproxyserviceinboundtransportistransactionalandthevalueofthequalityOfServiceelementisexactlyoncetoanoutbound
JMS/XAtransport.
Atleastonce Theproxyserviceinboundtransportisle,FTP,oremailandthevalueofthequalityOfServiceelementisexactlyonce.
Atleastonce TheproxyserviceinboundtransportistransactionalandthevalueofthequalityOfServiceelement,whereapplicable,isexactly
oncetoanoutboundtransportthatisnottransactional.
Nodelivery Allothercases,includingallresponseprocessingcases.
guarantee
Note: TosupportatleastonceandexactlyoncedeliveryguaranteeswithJMS,youmustexploitJMStransactionsandcongurearetrycountandretry
intervalontheJMSqueuetoensurethatthemessageisredeliveredintheeventofaservercrashorafailurethatisnothandledinanerrorhandler
withaReplyorResumeaction.File,FTP,andemailtransportsalsointernallyuseaJMS/XAqueue.Thedefaultretrycountforaproxyservice
withaJMS/XAtransportis1.ForalistofthedefaultJMSqueuescreatedbyOracleServiceBus,seetheOracleServiceBusDeploymentGuide
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/deploy/index.html).
Thefollowingareadditionaldeliveryguaranteerules:
IfthetransportoftheinboundproxyserviceisFile,FTP,email,TransactionalTuxedo,orJMS/XA,therequestprocessingisperformedinatransaction.
WhenthequalityOfServiceelementissettoexactlyonce,anyroutenodeandpublishactionsexecutedintherequestowtoatransactional
destinationareperformedinthesametransaction.
WhenthequalityOfServiceelementissettobesteortforanyactioninaroutenode,servicecalloutorpublishactionsareexecutedoutsideofthe
requestowtransaction.Specically,forJMS,Tuxedo,TransactionalTuxedo,orEJBtransport,therequestowtransactionissuspendedandthe
TransactionalTuxedoworkisdonewithoutatransactionorinaseparatetransactionthatisimmediatelycommi ed.
Ifanerroroccursduringrequestprocessing,butiscaughtbyausererrorhandlerthatmanagestheerror(byusingtheresumeorreplyaction),the
messageisconsideredsuccessfullyprocessedandthetransactioncommits.Atransactionisabortedifthesystemerrorhandlerreceivestheerrorthat
is,iftheerrorisnothandledbeforereachingthesystemlevel.Thetransactionisalsoabortedifaserverfailureoccursduringrequestpipeline
processing.
IfaresponseisreceivedbyaproxyservicethatusesaJMS/XAtransporttobusinessservice(andtheproxyinboundisnotTransactionalTuxedo),the
responseprocessingisperformedinasingletransaction.
WhenthequalityOfServiceelementissettoexactlyonce,allroute,servicecallout,andpublishactionsareperformedinthesametransaction.
WhenthequalityOfServiceelementissettobesteort,allpublishactionsandservicecalloutactionsareexecutedoutsideoftheresponseow
transaction.Specically,forJMS,EJB,ortransactionalTuxedotypesoftransports,theresponseowtransactionissuspendedandtheserviceisinvoked
withoutatransactionorinaseparatetransactionthatisimmediatelycommi ed.
ProxyserviceresponsesexecutedintheresponseowtoaJMS/XAdestinationarealwaysperformedinthesametransaction,regardlessofthe
qualityOfServiceelementse ing.
IftheproxyserviceinboundtransportistransactionalTuxedo,boththerequestprocessingandresponseprocessingaredoneinthistransaction.
Note: YouwillencounteraruntimeerrorwhentheinboundtransportistransactionalTuxedoandtheoutboundisanasynchronoustransport,for
example,JMS/XA.
8.55.ThreadingModel
TheOracleServiceBusthreadingmodelworksasfollows:
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 41/45
5/9/2017 3DaysTutorialinOSB|SOALair
TheOracleServiceBusthreadingmodelworksasfollows:
Therequestandresponseowsinaproxyserviceexecuteindierentthreads.
Servicecalloutsarealwaysblocking.AnHTTProuteorpublishactionisnonblocking(forrequest/responseoronewayinvocation),ifthevalueofthe
qualityOfServiceelementisbesteort.
JMSrouteactionsorpublishactionsarealwaysnonblocking,buttheresponseislostiftheserverrestartsaftertherequestissentbecauseOracleService
Bushasnopersistentmessageprocessingstate.
Note: Inarequestorresponseowpublishaction,responsesarealwaysdiscardedbecausepublishactionsareinherentlyaonewaymessagesend.
8.56.SplittingProxyServices
Youmaywanttosplitaproxyserviceinthefollowingsituations:
WhenHTTPistheinboundandoutboundtransportforaproxyservice,youmaywanttoincorporateenhancedreliabilityintothemiddleofthemessage
ow.Toenableenhancedreliabilityinthisway,splittheproxyserviceintoafrontendHTTPproxyserviceandabackendJMS(onewayor
request/response)proxyservicewithanHTTPoutboundtransport.Intheeventofafailure,therstproxyservicemustquicklyplacethemessageinthe
queueforthesecondproxyservice,inordertoavoidlossofmessages.
TodisablethedirectinvocationoptimizationforanonJMStransportwhenaproxyservice,sayloanGateway1invokesanotherproxyservice,say
loanGateway2.RoutetotheproxyserviceloanGateway2fromtheproxyserviceloanGateway1wheretheproxyserviceloanGateway2usesJMS
transport.
TohaveanHTTPproxyservicepublishtoaJMSqueuebuthavethepublishactionrollbackifthereisaexceptionlateronintherequestprocessing,split
theproxyserviceintoafrontendHTTPproxyserviceandabackendJMSproxyservice.ThepublishactionspeciesaqualityOfServiceelementof
exactlyonceandusesanXAconnectionfactory.
8.57.OutboundMessageRetries
InadditiontoconguringinboundretriesformessagesusingJMS,youcancongureoutboundretriesandloadbalancing.Loadbalancing,failover,and
retriesworkinconjunctiontoprovideperformanceandhighavailability.Foreachmessage,thelistofURLsyouprovideasfailoverURLsisautomatically
orderedbasedontheloadbalancingalgorithmintoafailoversequence.IftheretrycountisN,theentiresequenceisretriedNtimesbeforestopping.The
systemwaitsforthespeciedretryintervalbeforecommencingsubsequentloopsthroughthesequence.Aftercompletingtheretrya empts,ifthereisstill
anerror,theerrorhandlerpipelinefortheroutenodeisinvoked.Formoreinformationontheerrorhandlerpipeline,seeAddingPipelineErrorHandling
inProxyServices(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyservices.html)inUsingtheOracleServiceBusConsole.
Note: ForHTTPtransports,anyHTTPstatusotherthan200or202isconsideredanerrorbyOracleServiceBusandmustberetried.Becauseofthis
algorithm,itispossiblethatOracleServiceBusretrieserrorslikeauthenticationfailurethatmayneverberectiedforthatURLwithinthe
timeperiodofinterest.Ontheotherhand,ifOracleServiceBusalsofailsovertoadierentURLforsubsequenta emptstosendagiven
message,thenewURLmaynotgivetheerror.
Note: Forqualityofservice=exactlyoncefailoverorretrieswillnotbeexecuted.
8.58.ContentTypes,JMSType,andEncoding
Tosupportinteroperabilitywithheterogeneousendpoints,OracleServiceBusallowsyoutocontrolthecontenttype,theJMStype,andtheencodingused.
OracleServiceBusdoesnotmakeassumptionsaboutwhattheexternalclientorserviceneeds,butusestheinformationconguredforthispurposeinthe
servicedenition.OracleServiceBusderivesthecontenttypeforoutboundmessagesfromtheservicetypeandinterface.Contenttypeisapartoftheemail
andHTTPprotocols.
Iftheservicetypeis:
XMLorSOAPwithorwithoutaWSDL,thecontenttypeistext/XML.
MessagingandtheinterfaceisMFLorbinary,thecontenttypeisbinary/octetstream.
Messagingandtheinterfaceistext,thecontenttypeistext/plain.
MessagingandtheinterfaceisXML,thecontenttypeistext/XML.
Additionally,thereisaJMStype,whichcanbebyteortext.YouconguretheJMStypetousewhenyoudenetheserviceinOracleServiceBusConsoleor
intheOracleServiceBusPluginsforWorkshopforWebLogic.
Youcanoverridethecontenttypeintheoutboundcontextvariable($outbound)forproxyservicesinvokingaservice,andintheinboundcontextvariable
($inbound)foraproxyserviceresponse.Formoreinformationon$outboundand$inboundcontextvariables,seeInboundandOutboundVariables
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1107145).
Encodingisalsoexplicitlyconguredintheservicedenitionforalloutboundmessages.Formoreinformationonservicedenitions,seeProxyServices 42/45
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/
5/9/2017 3DaysTutorialinOSB|SOALair
Encodingisalsoexplicitlyconguredintheservicedenitionforalloutboundmessages.Formoreinformationonservicedenitions,seeProxyServices
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyservices.html)inandBusinessService
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/businessServices.html)inUsingtheOracleServiceBusConsole.
8.59.ThrottlingPattern
InOracleServiceBus,youcanrestrictthemessageowtoabusinessservice.Thistechniqueofrestrictingamessageowtoabusinessserviceisknownas
thro ling.Forinformation,seeThro linginOracleServiceBus(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/operations/thro ling.html)in
theOracleServiceBusOperationsGuide.
8.60.WSICompliance
OracleServiceBusprovidesWebServiceInteroperability(WSI)complianceforSOAP1.1servicesintheruntimeenvironment.TheWSIbasicprolehas
thefollowinggoals:
DisambiguatetheWSDLandSOAPspecicationswhereverambiguityexists.
DeneconstraintsthatcanbeappliedwhenreceivingmessagesorimportingWSDLssothatinteroperabilityisenhanced.Whenmessagesaresent,
constructthemessagesothattheconstraintsaresatised.
TheWSIbasicproleisavailableatthefollowingURL:
h p://www.wsi.org/Proles/BasicProle1.1.html(h p://www.wsi.org/Proles/BasicProle1.1.html).
WhenyoucongureaproxyserviceorbusinessservicebasedonaWSDL,youcanusetheOracleServiceBusConsoleortheOracleServiceBusPluginsfor
WorkshopforWebLogictospecifywhetheryouwantOracleServiceBustoenforceWSIcompliancefortheservice.Forinformationonhowtodothis,see
OperationSelectionCongurationpageunderProxyServices
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyservices.html)inUsingtheOracleServiceBusConsole
ProxyServiceOperationSelectionCongurationpageinUsingtheOracleServiceBusPluginsforWorkshopforWebLogic
WhenyoucongureWSIcomplianceforaproxyservice,checksareperformedoninboundrequestmessagesreceivedbythatproxyservice.Whenyou
congureWSIcomplianceforaninvokedservice,checksareperformedwhenanyproxyreceivesaresponsemessagefromthatinvokedservice.Oracle
recommendsthatyoucreateanerrorhandlerfortheseerrors,sincebydefault,theproxyserviceSOAPclientreceivesasystemerrorhandlerdenedfault.
Formoreinformationoncreatingfaulthandlers,see:
ProxyServices:ErrorHandlers(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/proxyerrors.html)inUsingtheOracleService
BusConsole.
AddingandConguringErrorHandlersinMessageFlows
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/eclipsehelp/tasks.html#taskAddCongErrorHandlersInMessageFlows)inUsingtheOracle
ServiceBusPluginsforWorkshopforWebLogic.
Formessagessentfromaproxyservice,whetherasoutboundrequestorinboundresponse,WSIcompliancechecksarenotexplicitlyperformed.Thatis
becausethepipelinedesignerisresponsibleforgeneratingmostofthemessagecontent.However,thepartsofthemessagegeneratedbyOracleServiceBus
shouldsatisfyallofthesupportedWSIcompliancechecks.Thisincludesthefollowingcontent:
Serviceinvocationrequestmessage.
Systemgeneratederrormessagesreturnedbyaproxyservice.
HTTPstatuscodesgeneratedbyaproxyservice.
TheEnforceWSICompliancecheckboxisdisplayedasshowninFigure311
(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1066223).
Figure311EnforceWSIComplianceCheckbox
8.61.WSIComplianceChecks
Note: WSIcompliancechecksrequirethatthesystemknowswhatoperationisbeinginvokedonaservice.Forrequestmessagesreceivedbyaproxy
service,thatmeansthatthecontextvariable$operationshouldnotbenull.Thatdependsupontheoperationselectionalgorithmbeingcongured
properly.Forresponsemessagesreceivedfrominvokedservices,theoperationshouldbespeciedintheactioncongurationsforroute,publish,
andservicecallout.
WhenyoucongureWSIcompliancecheckingforaproxyserviceorabusinessservice,OracleServiceBuscarriesoutthefollowingchecks,shownin
Table311(h p://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageow.html#wp1065557).
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 43/45
5/9/2017 3DaysTutorialinOSB|SOALair
R1125Aninstancemustusea4xxHTTPstatuscodefora
responsethatindicatesaproblemwiththeformatofarequest.
R2755Thepartaccessorelementsinamessagedescribedwith
anrpcliteralbindingmusthavealocalnameofthesamevalue
asthenamea ributeofthecorrespondingwsdl:partelement.
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 44/45
5/9/2017 3DaysTutorialinOSB|SOALair
R2745AHTTPrequestmessagemustcontainaSOAPactiona
HTTPheadereldwithaquotedemptystringvalue,ifinthe
correspondingWSDLdescription,theSOAPActionof
soapbind:operationiseithernotpresent,orpresentwithan
emptystringasitsvalue.
1.brahmasays:
August19,2012at7:58pm
helloanubhav,thisisvenkatafromhyderabad,iamgoodinterestedtolearnoracleosb,couldyoupleaseprovideyourcontactdetailssothatican
contactyou
canuprovideonlinetrainingforOSB?
Reply(h ps://soalair.wordpress.com/2011/11/23/3daystutorialinosb/?replytocom=14#respond)
CreateafreewebsiteorblogatWordPress.com.(h ps://wordpress.com/?ref=footer_website)
https://soalair.wordpress.com/2011/11/23/3daystutorialinosb/ 45/45