Sumário Itens Encontrados: 676Preface 1Part 1: Getting StartedChapter 1: Introduction to Oracle SOA Suite 11Service-oriented architecture in short 11Service 11Orientation 12Architecture 13Why SOA is different 14Terminology 15Interoperability 15Extension and evolution 15Reuse in place 16Service Component Architecture (SCA) 16Component 17Service 17Reference 17Wire 17Composite.xml 17Properties 18SOA Suite components 18Services and adapters 18ESB â service abstraction layer 19Oracle Service Bus and Oracle Mediator 20Service orchestration â the BPEL process manager 21Rules 22Security and monitoring 22Active monitoring â BAM 23Business to Business â B2B 24Complex Event Processing â CEP 24Event delivery network 24SOA Suite architecture 24Top level 25Component view 25Implementation view 26A recursive example 27JDeveloper 27Other components 27Service repository and registry 28BPA Suite 28The BPM Suite 28Portals and WebCenter 28Enterprise manager SOA management pack 29Summary 29Chapter 2: Writing your First Composite 31Installing SOA Suite 31Writing your first BPEL process 32Creating an application 34Creating an SOA project 36SOA project composite templates 37Creating a BPEL process 38Assigning values to variables 40Deploying the process 42Testing the BPEL process 45Adding a Mediator 51Using the Service Bus 54Writing our first proxy service 55Writing the Echo proxy service 56Creating a Change Session 57Creating a project 58Creating the project folders 58Creating service WSDL 60Importing a WSDL 61Creating our business service 64Creating our proxy service 67Creating message flow 69Activating the Echo proxy service 70Testing our proxy service 72Summary 75Chapter 3: Service-enabling Existing Systems 77Types of systems 77Web service interfaces 78Technology interfaces 78Application interfaces 80Java Connector Architecture 80Creating services from files 80A payroll use case 81Reading a payroll file 81Starting the wizard 82Naming the service 82Identifying the operation 83Defining the file location 85Selecting specific files 86Detecting that the file is available 88Message format 89Finishing the wizards 97Throttling the file and FTP adapter 98Creating a dummy message type 98Adding an output message to the read operation 98Using the modified interface 98Writing a payroll file 99Selecting the FTP connection 99Choosing the operation 100Selecting the file destination 100Completing the FTP file writer service 102Moving, copying, and deleting files 102Generating an adapter 102Modifying the port type 102Modifying the binding 103Configuring file locations through additional header properties 104Adapter headers 105Testing the file adapters 105Creating services from databases 106Writing to a database 106Selecting the database schema 106Identifying the operation type 107Identifying tables to be operated on 108Identifying the relationship between tables 109Under the covers 110Summary 110Chapter 4: Loosely-coupling Services 111Coupling 111Number of input data items 112Number of output data items 112Dependencies on other services 113Dependencies of other services on this service 113Use of shared global data 114Temporal dependencies 114Reducing coupling in stateful services 115Service abstraction tools in SOA Suite 119Do you have a choice? 119When to use the Mediator 120When to use Oracle Service Bus 120Oracle Service Bus design tools 121Oracle Workshop for WebLogic 121Oracle Service Bus Console 121Service Bus overview 121Service Bus message flow 122Virtualizing service endpoints 122Moving service location 123Using Adapters in Service Bus 125Selecting a service to call 126Virtualizing service interfaces 128Physical versus logical interfaces 128Mapping service interfaces 130Applying canonical form in the Service Bus 135An important optimization 136Using the Mediator for virtualization 136Summary 138Chapter 5: Using BPEL to Build Composite Servicesand Business Processes 139Basic structure of a BPEL process 140Core BPEL process 140Variables 141Partner links 142Messaging activities 142Synchronous messaging 142Asynchronous messaging 143A simple composite service 144Creating our StockQuote service 145Importing StockService schema 146Calling the external web services 148Calling the web service 150Assigning values to variables 153Testing the process 154Calling the exchange rate web service 154Assigning constant values to variables 155Using the expression builder 156Asynchronous service 160Using the wait activity 163Improving the stock trade service 164Creating the while loop 164Checking the price 166Using the switch activity 167Summary 170Chapter 6: Adding in Human Workflow 171Workflow overview 171Leave approval workflow 172Defining the human task 173Specifying task parameters 175Specifying task assignment and routing policy 176Invoking our human task from BPEL 180Creating the user interface to process the task 181Running the workflow process 183Processing tasks with the worklist application 184Improving the workflow 186Dynamic task assignment 186Assigning tasks to multiple users or groups 188Cancelling or modifying a task 189Withdrawing a task 189Modifying a task 189Difference between task owner and initiator 190Requesting additional information about a task 190Managing the assignment of tasks 191Reassigning reportee tasks 191Reassigning your own task 193Delegating tasks 193Escalating tasks 193Using rules to automatically manage tasks 194Setting up a sample rule 195Summary 198Chapter 7: Using Business Rules to Define Decision Points 199Business rule concepts 200XML facts 200Decision services 201Leave approval business rule 201Creating a decision service 202Implementing our business rules 204Adding a rule to our ruleset 206Creating the IF clause 207Creating the Then clause 208Calling a business rule from BPEL 211Assigning facts 212Using functions 213Creating a function 214Testing a function 219Testing decision service functions 220Invoking a function from within a rule 221Using decision tables 222Defining a bucket set 222Creating a decision table 224Conflict resolution 229Summary 231Chapter 8: Using Business Events 233How EDN differs from traditional messaging 233A sample use case 235Event Delivery Network essentials 235Events 235Event publishers 238Publishing an event using the Mediator component 238Publishing an event using BPEL 240Publishing an event using Java 243Event subscribers 245Consuming an event using Mediator 245Consuming an event using BPEL 248EDN publishing patterns with SOA Suite 250Publishing an event on receipt of a message 251Publishing an event on a synchronous message response 251Publishing an event on a synchronous message request and reply 252Publishing an event on an asynchronous response 252Publishing an event on an asynchronous message request and reply 253Publishing an event on an event 253Monitoring event processing in Enterprise Manager 254Summary 256Chapter 9: Building Real-time Dashboards 257How BAM differs from traditional business intelligence 257Oracle BAM scenarios 258BAM architecture 259Logical view 259Physical view 260Acquire 260Store 261Process 261Deliver 262Steps in using BAM 263User interface 263Monitoring process state 264Defining reports and data required 265Defining data objects 265A digression on populating data object fields 268Instrumenting BPEL and SCA 269Invoking the BAM adapter as a regular service 269Invoking the BAM adapter through BPEL sensors 273Testing the events 278Creating a simple dashboard 278Monitoring process status 279Monitoring KPIs 282Summary 283Part 2: Putting it All TogetherChapter 10: oBay Introduction 287oBay requirements 288User registration 288User login 288Selling items 288List a new item 289Completing the sale 290View account 291Buying items 291Search for items 292Bidding on items 292Defining our blueprint for SOA 294Architecture goals 294Typical SOA Architecture 295Application services layer 297Virtual services layer 297Business services layer 299Business process 302User interface layer 303One additional layer 304Where the SOA Suite fits 306Composite application 308Composite granularity 308Basic composite design pattern 311Where to implement virtual services 312Mediator as a proxy for a composite 312Mediator as a proxy for an external reference 312Using a composite as a virtual service 313Service invocation between composite applications 314oBay high-level architecture 316oBay application services 316Workflow services 316External web services 317oBay developed services 317oBay internal virtual services 317oBay business services 317oBay business processes 318oBay user interface 318Summary 319Chapter 11: Designing the Service Contract 321Using XML Schema to define business objects 322Modeling data in XML 322Data decomposition 322Data hierarchy 323Data semantics 324Using attributes for metadata 324Schema guidelines 325Element naming 325Namespace considerations 327Partitioning the canonical model 334Single namespace 335Multiple namespaces 336Using WSDL to define business services 337Use Document (literal) wrapped 338Building your abstract WSDL document 338WSDL namespace 338Defining the 'wrapper'elements 339Defining the 'message'elements 341Defining the 'PortType'Element 342Using XML Schema and the WSDL within SOA Suite 342Sharing XML Schemas across composites 343Defining an MDS connection 344Importing schemas from MDS 345Manually importing schemas 346Deploying schemas to the SOA infrastructure 349Importing the WSDL document into a composite 352Sharing XML Schemas in the Service Bus 353Importing the WSDL document into the Service Bus 354Strategies for managing change 356Major and minor versions 357Service implementation versioning 357Schema versioning 358Changing schema location 359Updating schema version attribute 359Resisting changing the schema namespace 359WSDL versioning 360Incorporating changes to the canonical model 360Changes to the physical contract 360Updating the service endpoint 361Including version identifiers in the WSDL definition 361Managing the service lifecycle 362Summary 363Chapter 12: Building Entity Services Using ServiceData Objects (SDOs) 365Service Data Objects 367Oracle 11g R1 support for SDO 367Oracle SOA Suite 11g SDO support 367Implementing a Service Data Object 368Overview of ADF Business Components 368Creating our ListingSDO application 370Creating our Listing Business Components 371Defining Entity objects 372Defining updatable View objects 373Defining the application module 373Testing the listing ADF-BC in JDeveloper 375Generating the primary key using an Oracle Sequence 375Creating the ADF extension class for EntityImpl 376Updating default ADF base classes 377Configuring Listing entity to use Oracle Sequence 378Creating the ListingSDO service interface 379Enabling master detail updates 380Deploying the Service Data Object 381Creating a service deployment profile 382Setting Web Context Root 382Registering SDO with SOA infrastructure 383Registering the ListingSDO as an RMI service 383Configuring global JDBC data source 384Determining the SDO registry key 385Using the ListingSDO in an SOA composite 386Creating an ADF-BC Service Reference 386Invoking the SDO from BPEL 387Creating an entity variable 388Creating a Listing entity 389Binding to the Listing entity 391Inserting a detail SDO into a master SDO 393Updating a detail SDO 395Deleting a detail SDO 395Deleting a Service Data Object 395Exposing the SDO as a business service 396Summary 398Chapter 13: Building Validation into Services 399Validation within a composite 400Using XML Schema validation 402Strongly-typed services 402Loosely-typed services 405Combined approach 406Schema validation within the Mediator 406Using schema validation within BPEL PM 407Using schema validation within the Service Bus 410Validation of inbound documents 411Validation of outbound documents 413Using Schematron for validation 413Overview of Schematron 414Assertions 415Rules 416Patterns 417Namespaces 417Schema 418Intermediate validation 418Cross field validation 418Date validation 420Element present 420Using Schematron within the Mediator 421Using the Metadata Service to hold Schematron files 422Returning Schematron errors 423Using Schematron with the Service Bus 423Putting validation in the underlying service 423Using Business Rules for validation 424Coding in validation 425Returning validation failures in synchronous services 425Defining faults 426Custom fault codes 426Validation failures in asynchronous services 427Layered validation considerations 428Dangers of over validation 428Dangers of under validation 429Negative coupling of validation 429Summary 430Chapter 14: Error Handling 431Business faults 432Defining faults in synchronous services 432Defining faults in asynchronous services 433Handling business faults in BPEL 434Catching faults 435Adding a catch branch 435Throwing faults 438Compensation 439Defining compensation 440Triggering a Compensation handler 440Adding a Compensate activity 441Returning faults 442Asynchronous Considerations 443Handling business faults in Mediators 443Synchronous Mediators 444System faults 445Asynchronous Mediators 445Using timeouts 446Using the fault management framework 446Using the fault management framework in BPEL 447Using the fault management framework in Mediator 447Defining a fault policies file 448Defining a fault policy 449Defining fault policy conditions 450Specifying the 450Specifying the 451Defining fault policy actions 452Retry action 453Human intervention action 453Abort action 454Rethrow action 454Replay scope action 455Java action 456Binding fault policies 457Defining bindings on the composite 457Binding resolution 458Using MDS to hold fault policy files 458Human intervention in Fusion Middleware Control Console 459Handling faults within the Service Bus 461Handling faults in synchronous proxy services 462Raising an error 462Defining an error handler 463Handling unexpected faults 467Returning a SOAP Fault 468Adding a service error handler 469Handling permanent faults 469Handling transient faults 471Handling faults in one-way proxy services 473Summary 473Chapter 15: Advanced SOA Suite Architecture 475Relationship of infrastructure to service engines 475Composite execution and suspension 476BPEL dehydration events 476Threading and message delivery in SOA Suite 476One-way message delivery 477Immediate execution of one-way messages in BPEL 478Activation agent threads 479Dispatcher threads 479Transactions 481BPEL transactions 481BPEL component properties 481BPEL partner link properties 482BPEL activities 483Transactions and thread wrinkles in BPEL 484Reply handling 484Oracle Service Bus (OSB) transactions 485Transactional binding 485Non-transactional binding 485Comparison to EJB 486Clustering 486Load balancing 487JMS considerations 487Testing considerations 488Adapter considerations 489Metadata repository considerations 489Database connections 489Summary 490Chapter 16: Message Interaction Patterns 491Messaging within a composite 491Processing of messages within the Mediator 493Processing of messages within BPEL PM 493Message addressing 494Multi-protocol support 494Message correlation 495WS-Addressing 496Request message with WS-Addressing 496Response message with WS-Addressing 497Using BPEL correlation sets 498Using correlation sets for multiple process interactions 499Defining a correlation set property 499Defining correlation set 500Using correlation sets 501Defining property aliases 505Message aggregation 507Message routing 509Correlating the callback 510Specifying the reply to address 510Creating a proxy process 511Using the pick activity 511Defining the correlation sets 513Completing the aggregation 514Scheduling services 515Defining the schedule file 516Using FlowN 517Accessing branch-specific data in FlowN 518Dynamic partner links 519Defining a common interface 520Defining a job partner link 521Recycling the scheduling file 523Summary 524Chapter 17: Workflow Patterns 525Managing multiple participants in a workflow 525Using multiple assignment and routing policies 526Determining the outcome by a group vote 526Using multiple human tasks 529Linking individual human tasks 530Using the workflow API 531Defining the order fulfillment human task 532Specifying task parameters 532Specifying the routing policy 534Notification settings 535Querying task instances 537Defining an external reference for the Task Query Service 538User authentication 539Querying tasks 541Flex fields 543Populating flex fields 543Accessing flex fields 544Specifying the query predicate 545Using flex fields in the query predicate 549Ordering the data 550Getting task details 551Updating a task instance 552Using the updateTask operation 552Updating the task payload 553Updating the task flex fields 554Updating the task outcome 554Summary 556Chapter 18: Using Business Rules to Implement Services 557How the rule engine works 557Asserting facts 558Executing the ruleset 558Rule activation 558Rule firing 559Retrieving result 559Session management 560Debugging a ruleset 561Debugging a decision service with a test function 561Debugging a decision service within a composite 561Using the print function to add additional logging 562Using business rules to implement auction 562Defining our XML facts 562Defining the business rule 565Configuring the decision function 566Using a global variable to reference the resultset 567Defining a global variable 568Defining a rule to initialize a global variable 568Writing our auction rules 571Evaluating facts in date order 571Checking for non-existent fact 571Updating the bid status 573Using inference 574Processing the next valid bid 575Using functions to manipulate XML facts 576Asserting a winning bid 577Retracting a losing bid 578Rules to process a new winning bid 579Validating the next bid 580Rule to process a losing bid 581Complete ruleset 582Performance considerations 583Managing state within the BPEL process 583Summary 584Part 3: Other ConsiderationsChapter 19: Packaging and Deployment 587The need for packaging 587Problems with moving between environments 587Types of interface 588Web interfaces 588Command-line interfaces 588SOA Suite packaging 588Oracle Service Bus 589Oracle SOA composites 590Deploying a SCA composite via the EM Console 590Deploying a SCA composite using Ant 592Revisions and milestones 598The default revision 599Enabling web service endpoint and WSDL location alteration 600Enabling adapter configuration 602XML schema locations 602XSL imports 602Composite configuration plan framework 603Web services security 607Oracle rules 608Business activity monitoring 608Commands 608Selecting items 608Using iCommand 609Summary 610Chapter 20: Testing Composite Applications 611SOA Suite testing model 611One-off testing 612Testing composites 612Testing the Service Bus 615Automated testing 616The composite test framework 616Composite test suites 616Injecting data into the test case 618Data validation 620Emulating components and references 622Deploying and running test suites 623Regression testing 625System testing 626Composite testing 627Component testing 627Unit testing 628Performance testing 629User interface testing 629Summary 630Chapter 21: Defining Security and Management Policies 631Security and management challenges in the SOA environment 631Evolution of security and management 632Added complications of SOA environment 633Security Impacts of SOA 634Management and monitoring impacts of SOA 634Securing services 636Security outside the SOA Suite 636Network security 636Preventing message interception 636Restricting access to services 637Declarative security versus explicit security 637Security as a facet 637Security as a service 637Security model 638Policy enforcement points 639Policies 639Agents and gateways 640Distinctive benefits of gateways and agents 641The gateway dilemma 642Service Bus model 642Defining policies 643Creating a new policy to perform authentication and authorization 644Creating the authorization policy 645Applying a policy through the Service Bus Console 652Importing a policy 652Applying OWSM policies in Service Bus 653Final thoughts on security 654Monitoring services 654Monitoring service health in SOA Suite 655System up-down status 655System throughput view 655Monitoring in the Service Bus 657Creating an alert destination 658Enabling service monitoring 659Creating an alert rule 660Monitoring the service 663What makes a good SLA 663Summary 664Index 665