Java Power to the SOA DeveloperODTUG Kaleidoscope 2010Wednesday, 30th JuneClemens Utschig-UtschigLucas Jellema AMIS, The Netherlands
OverviewThree perspectivesJava2SOA, SOA2Java, SOA running Java insideInvoking SOA Composite Application from JavaWebService, EJB and ADF Binding; JMSCalling Java from SOA Composite applicationEJB binding, JMS Adapter Service; direct & socketJava exposed as WebService and as ADF-BC SDOJava insideBPEL Embedded Java; Mediator Java CalloutSpring Context Service Component
From Java, To Java, Run JavaADF BCSDO ADF-BCJavaApplicationJAX-WSJava ClassJavaApplicationEJBADFEJBJavaApplicationJMSJavaApplicationJMS
Some material used from the bookShipping before OOWEnd of AugustOn SOA and SOA SuiteChapters on Java inside SOA Suite (Java Callout, EmbeddedJava BPEL activity, Springcomponent)EJB and ADF BindingInteraction betweenSOA Suite & ADFSDO Services & BPEL
Invoking SOA Composite Application from JavaCreate Java WebService client (JAX-WS)Generate in JDeveloper, based on WSDL and XSDCall over HTTP with XML based messagesExpose EJB Binding or ADF Binding from CompositeInvoke over RMI with XML or (serialized) POJOsInteract from Java over JMS, through Direct Binding or Socket Adapter
Expose EJB BindingCreate the SOA Composite applicationCreate a Java Interface that describes the service to be exposedCreate an EJB binding based on that interface as external Service exposed by the compositeCreate a Mediator wired to the EJB bindingThat routes incoming requests to ‘the rest of the composite’Create the Java client that calls over RMI
Create Composite application, WS interface and Java Interface
Create the (inbound) EJB Binding
Invoking the SOA Composite via the EJB Binding
Client of EJB Binding in action
Inbound ADF BindingExpose a service with  binding.adfBased on the same WSDL as the binding.wsWire this service to whatever the binding.ws service is wired toIncoming calls are overRMI and use XML according to WSDL/XSD
Client for ADF BindingUse SOA Suite run-time Java APILocator classpointed at t3://localhost:8001/soa-infraLookup Compositedefault/FilterAndTranslateWithADFBinding!1.0Find ServiceInvoke with XML messageResponse returned in XML
OverviewThree perspectivesJava2SOA, SOA2Java, SOA running Java insideInvoking SOA Composite Application from JavaWebService, EJB and ADF Binding; JMSCalling Java from SOA Composite applicationEJB binding, JMS Adapter Service; direct & socketJava exposed as WebService and as ADF-BC SDOJava insideBPEL Embedded Java; Mediator Java CalloutSpring Context Service Component
Invoking External Java based logicExpose Java application as JAX-WS WebServiceExpose ADF-BC with (SDO) Service InterfaceUse ADF-BC Binding Adapter and BPEL EntityInvoke Java EJB over EJB BindingCall out using Direct Binding or Socket AdapterInteract using JMS Adapter
Accessing Java based logic exposed by EJBsCreate and deploy EJBGet (remote) Java Interface and JNDI nameCreate EJB Binding (reference)Configure with JNDI name and Java InterfaceCreate wire  to the EJB BindingA WSDL is automatically derived from the Java interface definition
(outbound) EJB Binding
The WSDL is created upon wiring to the EJB binding
Run composite with call via outbound EJB binding
ADF BC providing Data Access service to BPEL processesSOA Suite communicates with database through Database AdapterSQL (select, DML), PL/SQL and pollingAlternatively, Service Data Objects and a Data Access Service can be usedXML and HTTP basedStateful dataset & two-way synchronization
ADF Faces Web ApplicationPatientAdministration(SDO) Web ServicePatientsServiceApplication ModulePatientsServiceSOA SuiteView ObjectPatientsVwEDNADF BusinessComponentsEntity ObjectPatientPATIENTS
ADF BC, SDO and BPELADF BC Application Module can be exposed as Service Interface that is SDO enabledThe SOA Suite ADF BC binding adapter connects to the SDO Service InterfaceBPEL Variables can be based on SDO EntityBPEL activity Create Entity does InsertBPEL activity Bind Entity does retrieveAssign in BPEL results in call to update on SDO
Expose ADF BC Service Interface
Test SDO enabled Service Interface
Using the ADF-BC Binding Adapter
Create SDO Entity based variable in BPEL process
BPEL activity Bind Entity does ‘select * into BPEL variable’
OverviewThree perspectivesJava2SOA, SOA2Java, SOA running Java insideInvoking SOA Composite Application from JavaWebService, EJB and ADF Binding; JMSCalling Java from SOA Composite applicationEJB binding, JMS Adapter Service; direct & socketJava exposed as WebService and as ADF-BC SDOJava insideBPEL Embedded Java; Mediator Java CalloutSpring Context Service Component
Run Java inside SOA CompositeExtend BPEL processes with Embedded JavaFor manipulation of variables, auditing/logging,external call-outs, validation,..Mediator Java CalloutBefore or after transformation ofrequest or replyFor validation, transformation & enrichment, logging, …Spring Context service component
Consult Preparation Service
Add translations using Google’s RESTful Translation ServiceJava Class StringTranslator publishes a static method translate that will translate strings:
Add embedded Java activity
Extend with Dutch translations
Extend with Dutch translations
Java Embedding in BPEL processHidden inside, not very decoupledHard to maintainMixing technology paradigms Requiring different skillsIn general:Useful for advanced logging/tracingUseful for special validations/transformationsUse with great caution
Mediator Java Call-outsMediators allow registration of a Java Callout classThis class extends from AbstractJavaCalloutImplMay override methods invoke at specific momentsin thelife cycle
Mediator Java Call-outsUsed for debugging & logging/auditing, advanced manipulation (enrichment?), complex validation
Java inside composites: Spring ComponentPrimary citizen in SCA Composite applicationsAs per the SCA SpecificationAs per 11gR1 PS2 (preview in PS1)POJOs configured as Spring Beans provide services inside the CompositeAnd potentially exposed externallySpring’s Dependency Injection is very similar to SCA’s Reference concept
Steps for adding Java logic to a composite applicationAdd Spring Context to the compositeA Spring Bean Configuration file is createdAdd bean definitions for POJOs based on Java InterfacesAdd sca:service elements to exposebeans as service to other componentsAdd sca:reference elements to get Service Components injected to satisfy a dependency
First Steps
Use Case: Add PDF generation to a composite applicationPDF Generating Spring Bean is defined in the Spring Content – with an sca:service
Dependency Injection: Spring Beans get Service Components injectedDependency injection is the heart and soul of SpringReferences in SCA are very similarSpring Beans can publish their dependencies as sca:reference elementsThat get exposed by the Spring ContextThese References can be satisfied by wiring in other Service ComponentsUsually Mediator
Second round
Third round
Injecting LogFileWriter & ConsoleLogger
48Summary and ConclusionSOA Composite applications can expose and access EJB bindings next to WebServiceBPEL Entity variables have direct SDO bindingService Adapters for Direct Binding, Sockets and JMS interact with Java applicationsboth incoming and outgoing interactionSpring Context Service Component allows Spring Beans (POJOs) to be run inside SOASpring Bean can be invoked as service Spring Bean can have service component injected
ResourcesPresentation and demos are on our bloghttp://technology.amis.nl/blogContact me at:lucas.jellema@amis.nl

Java power to the SOA developer (ODTUG Kaleidoscope 2010)

  • 1.
    Java Power tothe SOA DeveloperODTUG Kaleidoscope 2010Wednesday, 30th JuneClemens Utschig-UtschigLucas Jellema AMIS, The Netherlands
  • 2.
    OverviewThree perspectivesJava2SOA, SOA2Java,SOA running Java insideInvoking SOA Composite Application from JavaWebService, EJB and ADF Binding; JMSCalling Java from SOA Composite applicationEJB binding, JMS Adapter Service; direct & socketJava exposed as WebService and as ADF-BC SDOJava insideBPEL Embedded Java; Mediator Java CalloutSpring Context Service Component
  • 3.
    From Java, ToJava, Run JavaADF BCSDO ADF-BCJavaApplicationJAX-WSJava ClassJavaApplicationEJBADFEJBJavaApplicationJMSJavaApplicationJMS
  • 4.
    Some material usedfrom the bookShipping before OOWEnd of AugustOn SOA and SOA SuiteChapters on Java inside SOA Suite (Java Callout, EmbeddedJava BPEL activity, Springcomponent)EJB and ADF BindingInteraction betweenSOA Suite & ADFSDO Services & BPEL
  • 5.
    Invoking SOA CompositeApplication from JavaCreate Java WebService client (JAX-WS)Generate in JDeveloper, based on WSDL and XSDCall over HTTP with XML based messagesExpose EJB Binding or ADF Binding from CompositeInvoke over RMI with XML or (serialized) POJOsInteract from Java over JMS, through Direct Binding or Socket Adapter
  • 6.
    Expose EJB BindingCreatethe SOA Composite applicationCreate a Java Interface that describes the service to be exposedCreate an EJB binding based on that interface as external Service exposed by the compositeCreate a Mediator wired to the EJB bindingThat routes incoming requests to ‘the rest of the composite’Create the Java client that calls over RMI
  • 7.
    Create Composite application,WS interface and Java Interface
  • 8.
  • 9.
    Invoking the SOAComposite via the EJB Binding
  • 10.
    Client of EJBBinding in action
  • 11.
    Inbound ADF BindingExposea service with binding.adfBased on the same WSDL as the binding.wsWire this service to whatever the binding.ws service is wired toIncoming calls are overRMI and use XML according to WSDL/XSD
  • 12.
    Client for ADFBindingUse SOA Suite run-time Java APILocator classpointed at t3://localhost:8001/soa-infraLookup Compositedefault/FilterAndTranslateWithADFBinding!1.0Find ServiceInvoke with XML messageResponse returned in XML
  • 13.
    OverviewThree perspectivesJava2SOA, SOA2Java,SOA running Java insideInvoking SOA Composite Application from JavaWebService, EJB and ADF Binding; JMSCalling Java from SOA Composite applicationEJB binding, JMS Adapter Service; direct & socketJava exposed as WebService and as ADF-BC SDOJava insideBPEL Embedded Java; Mediator Java CalloutSpring Context Service Component
  • 14.
    Invoking External Javabased logicExpose Java application as JAX-WS WebServiceExpose ADF-BC with (SDO) Service InterfaceUse ADF-BC Binding Adapter and BPEL EntityInvoke Java EJB over EJB BindingCall out using Direct Binding or Socket AdapterInteract using JMS Adapter
  • 15.
    Accessing Java basedlogic exposed by EJBsCreate and deploy EJBGet (remote) Java Interface and JNDI nameCreate EJB Binding (reference)Configure with JNDI name and Java InterfaceCreate wire to the EJB BindingA WSDL is automatically derived from the Java interface definition
  • 16.
  • 17.
    The WSDL iscreated upon wiring to the EJB binding
  • 18.
    Run composite withcall via outbound EJB binding
  • 19.
    ADF BC providingData Access service to BPEL processesSOA Suite communicates with database through Database AdapterSQL (select, DML), PL/SQL and pollingAlternatively, Service Data Objects and a Data Access Service can be usedXML and HTTP basedStateful dataset & two-way synchronization
  • 20.
    ADF Faces WebApplicationPatientAdministration(SDO) Web ServicePatientsServiceApplication ModulePatientsServiceSOA SuiteView ObjectPatientsVwEDNADF BusinessComponentsEntity ObjectPatientPATIENTS
  • 21.
    ADF BC, SDOand BPELADF BC Application Module can be exposed as Service Interface that is SDO enabledThe SOA Suite ADF BC binding adapter connects to the SDO Service InterfaceBPEL Variables can be based on SDO EntityBPEL activity Create Entity does InsertBPEL activity Bind Entity does retrieveAssign in BPEL results in call to update on SDO
  • 22.
    Expose ADF BCService Interface
  • 23.
    Test SDO enabledService Interface
  • 24.
    Using the ADF-BCBinding Adapter
  • 25.
    Create SDO Entitybased variable in BPEL process
  • 26.
    BPEL activity BindEntity does ‘select * into BPEL variable’
  • 27.
    OverviewThree perspectivesJava2SOA, SOA2Java,SOA running Java insideInvoking SOA Composite Application from JavaWebService, EJB and ADF Binding; JMSCalling Java from SOA Composite applicationEJB binding, JMS Adapter Service; direct & socketJava exposed as WebService and as ADF-BC SDOJava insideBPEL Embedded Java; Mediator Java CalloutSpring Context Service Component
  • 28.
    Run Java insideSOA CompositeExtend BPEL processes with Embedded JavaFor manipulation of variables, auditing/logging,external call-outs, validation,..Mediator Java CalloutBefore or after transformation ofrequest or replyFor validation, transformation & enrichment, logging, …Spring Context service component
  • 30.
  • 31.
    Add translations usingGoogle’s RESTful Translation ServiceJava Class StringTranslator publishes a static method translate that will translate strings:
  • 32.
  • 34.
    Extend with Dutchtranslations
  • 35.
    Extend with Dutchtranslations
  • 36.
    Java Embedding inBPEL processHidden inside, not very decoupledHard to maintainMixing technology paradigms Requiring different skillsIn general:Useful for advanced logging/tracingUseful for special validations/transformationsUse with great caution
  • 37.
    Mediator Java Call-outsMediatorsallow registration of a Java Callout classThis class extends from AbstractJavaCalloutImplMay override methods invoke at specific momentsin thelife cycle
  • 38.
    Mediator Java Call-outsUsedfor debugging & logging/auditing, advanced manipulation (enrichment?), complex validation
  • 39.
    Java inside composites:Spring ComponentPrimary citizen in SCA Composite applicationsAs per the SCA SpecificationAs per 11gR1 PS2 (preview in PS1)POJOs configured as Spring Beans provide services inside the CompositeAnd potentially exposed externallySpring’s Dependency Injection is very similar to SCA’s Reference concept
  • 40.
    Steps for addingJava logic to a composite applicationAdd Spring Context to the compositeA Spring Bean Configuration file is createdAdd bean definitions for POJOs based on Java InterfacesAdd sca:service elements to exposebeans as service to other componentsAdd sca:reference elements to get Service Components injected to satisfy a dependency
  • 41.
  • 42.
    Use Case: AddPDF generation to a composite applicationPDF Generating Spring Bean is defined in the Spring Content – with an sca:service
  • 44.
    Dependency Injection: SpringBeans get Service Components injectedDependency injection is the heart and soul of SpringReferences in SCA are very similarSpring Beans can publish their dependencies as sca:reference elementsThat get exposed by the Spring ContextThese References can be satisfied by wiring in other Service ComponentsUsually Mediator
  • 45.
  • 46.
  • 47.
  • 48.
    48Summary and ConclusionSOAComposite applications can expose and access EJB bindings next to WebServiceBPEL Entity variables have direct SDO bindingService Adapters for Direct Binding, Sockets and JMS interact with Java applicationsboth incoming and outgoing interactionSpring Context Service Component allows Spring Beans (POJOs) to be run inside SOASpring Bean can be invoked as service Spring Bean can have service component injected
  • 49.
    ResourcesPresentation and demosare on our bloghttp://technology.amis.nl/blogContact me at:lucas.jellema@amis.nl

Editor's Notes

  • #7 http://technology.amis.nl/blog/8144/publish-soa-composite-application-as-ejb-to-be-invoked-from-java-applications-using-ejb-binding