Define the following service-level configuration properties for the provider ABCS Ensure that you have the following namespace prefixes defined in your BPEL

13-20 Developers Guide for Oracle Application Integration Architecture Foundation Pack

13.4 Developing ABCS for CAVS Enablement

This section provides instructions on how to develop Oracle AIA services that are ready to work with the Composite Application Validation System CAVS. This section includes the following topics: ■ Section 13.4.1, How to CAVS Enable Provider ABCS ■ Section 13.4.2, How to CAVS Enable the Requester ABCS ■ Section 13.4.3, Introduction to the CAVSEndpointURL Value Designation ■ Section 13.4.4, Purging CAVS-Related Cross-Reference Entries to Enable Rerunning of Test Scenarios For more information about using the CAVS, see Oracle Application Integration Architecture Foundation Pack: Infrastructure Components and Utilities Guide, Working with the CAVS.

13.4.1 How to CAVS Enable Provider ABCS

Provider ABCSs that are asynchronous and invoke a callback to a ResponseEBS service must also CAVS-enable that invocation. Developers must populate a value for the property: Routing.PartnerLinkName.TargetSystemID.EndpointURI as shown below. You must provide the above property in the service configuration file if the value for the property Routing.PartnerLink.RouteToCAVS is given as false. To code a provider ABCS for dynamic CAVS-enabled PartnerLinks for invoking target participating application Web services:

1. Define the following service-level configuration properties for the provider ABCS

as shown in Example 13–3 : Example 13–3 Defining service-level configuration properties for the provider ABCS Property name=Default.SystemID[DefaultTargetSystemID]Property Property name=Routing.[PartnerlinkName].RouteToCAVS[true|false]Property Property name=Routing.[PartnerlinkName].[TargetSystemID].EndpointURI[AppEndpointURL] Property Property name=Routing.[PartnerlinkName].CAVS.EndpointURI[CAVSEndpointURL]Property The CAVSEndPointURL value is set at design time. For more information about the design-time designation of the CAVSEndPointURL, see Section 13.4.3, Introduction to the CAVSEndpointURL Value Designation .

2. Ensure that you have the following namespace prefixes defined in your BPEL

process as shown in Example 13–4 : Tip: CAVS configurations are only required when simulators are a part of the testing scenario. These configurations lay the foundation for allowing services to route messages to simulators. Completing ABCS Development 13-21 Example 13–4 Defining namespace prefixes in the BPEL process xmlns:xsd=http:www.w3.org2001XMLSchema xmlns:wsa=http:schemas.xmlsoap.orgws200303addressing xmlns:corecom=http:xmlns.oracle.comEnterpriseObjectsCoreCommonV2 3. Add this variable to your global variables section: variable name=SystemID type=xsd:string 4. Add an attachment named AddTargetSystemID.xsl to your BPEL project in the xsl directory. Be sure to replace the [ABCServiceNamespace] and [ABCServiceName] tokens in the file appropriately. 5. Add the assignment shown in Example 13–5 as the first step in the BPEL process. Be sure to replace the tokens appropriately: Example 13–5 Adding an assignment assign name=GetTargetSystemID copy from expression=ora:processXSLTAddTargetSystemID.xsl, bpws:getVariableData[RequestEBMVariableName], [RequestEBMPartName] to variable=[RequestEBMVariableName] part=[RequestEBMPartName] copy copy from variable=[RequestEBMVariableName] part=[RequestEBMPartName] query=[NamespacePrefixedEBMName]corecom:EBMHeadercorecom: Targetcorecom:ID to variable=SystemID copy assign 6. Add the following scope as shown in Example 13–6 once for each PartnerLink before its invoke activity: a. Replace the tokens in the AssignDynamicPartnerlinkVariables assignment activity to set the variables appropriately. b. Update the PartnerLink name token in the AssignPartnerlinkEndpointReference assignment activity. c. Updating the embedded Java code should not be necessary. Example 13–6 Adding scope for each PartnerLink scope name=SetDynamicPartnerlinkScope variables variable name=TargetEndpointLocation type=xsd:string variable name=EndpointReference element=wsa:EndpointReference variable name=ServiceName type=xsd:string variable name=PartnerLinkName type=xsd:string variable name=EBMMsgBpelVariableName type=xsd:string variable name=EBMMsgPartName type=xsd:string variables sequence name=SetDynamicPartnerlinkSequence assign name=AssignDynamicPartnerlinkVariables copy 13-22 Developers Guide for Oracle Application Integration Architecture Foundation Pack from expression={[ABCServiceNamespace]}[ABCServiceName] to variable=ServiceName copy copy from expression=[PartnerlinkName] to variable=PartnerLinkName copy copy from expression=[RequestEBMVariableName] to variable=EBMMsgBpelVariableName copy copy from expression=[RequestEBMPartName] to variable=EBMMsgPartName copy assign bpelx:exec name=GetTargetEndpointLocation language=java version=1.5 [CDATA[------------------------------------------------------ This code snippet will derive the dynamic endpoint URI for a partnerlink. ----------------------------------------------------------------- java.lang.String serviceName = java.lang.StringgetVariableDataServiceName; java.lang.String partnerLinkName = java.lang.StringgetVariableDataPartnerLinkName; java.lang.String cavsEndpointPropertyName = Routing.+partnerLinkName+.CAVS.EndpointURI; java.lang.String ebmMsgBpelVariableName = java.lang.StringgetVariableDataEBMMsgBpelVariableName; java.lang.String ebmMsgPartName = java.lang.StringgetVariableDataEBMMsgPartName; java.lang.String systemIdBpelVariableName = SystemID; java.lang.String targetEndpointLocationBpelVariableName = TargetEndpointLocation; java.lang.String routeToCavsPropertyName = Routing.+partnerLinkName+.RouteToCAVS; java.lang.String defaultSystemIdPropertyName = Default.SystemID; java.lang.String targetEndpointLocation = null; java.lang.String targetID = null; boolean addAudits = false; if addAudits addAuditTrailEntryPartnerlink = + partnerLinkName; check configuration for CAVS routing flag try { boolean routeToCAVS = java.lang.Boolean.parseBooleanoracle.apps.aia.core.config.Configuration. getServicePropertyserviceName, routeToCavsPropertyName; if addAudits addAuditTrailEntryRouteToCAVS = + routeToCAVS; if routeToCAVS { targetEndpointLocation = oracle.apps.aia.core.config.Configuration. getServicePropertyserviceName, cavsEndpointPropertyName; if addAudits addAuditTrailEntryEndpoint = + targetEndpoint Location + selected from configuration property + cavsEndpointPropertyName; } } catch oracle.apps.aia.core.config.PropertyNotFoundException e { if addAudits addAuditTrailEntryConfiguration property + cavs Completing ABCS Development 13-23 EndpointPropertyName + not found; } if targetEndpointLocation==null || targetEndpointLocation== { check bpel variable for already retrieved target system Id try { targetID = java.lang.StringgetVariableDatasystemIdBpel VariableName; if addAudits targetID=null addAuditTrailEntryUsing previously stored Target System ID = + targetID + ; } catch com.oracle.bpel.client.BPELFault e { } if targetID==null || targetID== { try to get Target system ID from EBM Header try { oracle.xml.parser.v2.XMLElement targetIdElement = oracle.xml.parser.v2.XMLElement getVariableDataebmMsgBpelVariableName, ebmMsgPartName, corecom:EBMHeader[1]corecom:Targetcorecom:ID [text=]; targetID = targetIdElement.getText; if addAudits addAuditTrailEntryTarget System ID = + targetID + , selected from EBM header; } catch com.oracle.bpel.client.BPELFault e { if addAudits addAuditTrailEntryUnable to retrieve Target System ID from message header; } try { if targetID=null targetID= setVariableDatasystemIdBpelVariableName, targetID; } catch com.oracle.bpel.client.BPELFault e { } } if targetID==null || targetID== { try to get Target system ID from configuration try { targetID = oracle.apps.aia.core.config.Configuration.getService PropertyserviceName, defaultSystemIdPropertyName; if addAudits addAuditTrailEntryTarget System ID = + targetID + , selected from configuration property + defaultSystemIdPropertyName; } catch oracle.apps.aia.core.config.PropertyNotFoundException e { if addAudits addAuditTrailEntryConfiguration property + defaultSystemIdPropertyName + not found; } try { if targetID=null targetID= setVariableDatasystemIdBpel VariableName, targetID; } catch com.oracle.bpel.client.BPELFault e { } } if targetID=null || targetID= { 13-24 Developers Guide for Oracle Application Integration Architecture Foundation Pack try to get EndpointLocation from Configuration java.lang.String endpointPropertyName = Routing.+partnerLinkName+ .+targetID+.EndpointURI; try { targetEndpointLocation = oracle.apps.aia.core.config.Configuration.getServicePropertyserviceName, endpointPropertyName; if addAudits addAuditTrailEntryEndpoint = + targetEndpointLocation + selected from configuration property + endpointPropertyName; } catch oracle.apps.aia.core.config.PropertyNotFoundException e { if addAudits addAuditTrailEntryConfiguration property + endpointPropertyName + not found; } } } try { setVariableDatatargetEndpointLocationBpelVariableName, targetEndpoint Location; } catch com.oracle.bpel.client.BPELFault e { }]] bpelx:exec switch name=Switch_SetEndpoint case condition=string-lengthbpws:getVariableDataTarget EndpointLocation0 assign name=AssignPartnerlinkEndpointReference copy from wsa:EndpointReference xmlns:wsa=http:schemas. xmlsoap.orgws200303addressing wsa:Address wsa:EndpointReference from to variable=EndpointReference copy copy from variable=TargetEndpointLocation to variable=EndpointReference query=wsa:EndpointReferencewsa:Address copy copy from variable=EndpointReference to partnerLink=[PartnerlinkName] copy assign case otherwise empty name=Empty_NoSetEndpoint otherwise switch sequence scope Completing ABCS Development 13-25

13.4.2 How to CAVS Enable the Requester ABCS